From 28a920b54082a0f85d269687e185f296224f5885 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 15 Jan 2019 23:15:21 -0700 Subject: [PATCH] Fix up some of the Javascript tests --- package.json | 6 +++--- tests/js/test_display.js | 16 +++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index e73730558..d92d2d143 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,11 @@ }, "dependencies": { "jasmine-core": "^2.6.4", - "karma": "^1.7.0", - "karma-coverage": "^1.1.1", + "karma": "^3.1.4", + "karma-coverage": "^1.1.2", "karma-jasmine": "^1.1.0", "karma-phantomjs-launcher": "^1.0.4", - "phantomjs-prebuilt": "^2.1.14" + "phantomjs-prebuilt": "^2.1.16" }, "scripts": { "test": "karma start" diff --git a/tests/js/test_display.js b/tests/js/test_display.js index bda2c39a0..196ba06bb 100644 --- a/tests/js/test_display.js +++ b/tests/js/test_display.js @@ -78,8 +78,8 @@ describe("The Display object", function () { overview: false, center: false, help: false, - transition: "slide", - backgroundTransition: "fade", + transition: "none", + backgroundTransition: "none", viewDistance: 9999, width: "100%", height: "100%" @@ -274,10 +274,9 @@ describe("Display.setImageSlides", function () { }); it("should add a list of images", function () { - var slides = [{"file": "file://openlp1.jpg"}, {"file": "file://openlp2.jpg"}]; + var slides = [{"path": "file:///openlp1.jpg"}, {"path": "file:///openlp2.jpg"}]; spyOn(Display, "clearSlides"); spyOn(Display, "reinit"); - spyOn(Reveal, "slide"); Display.setImageSlides(slides); @@ -286,10 +285,9 @@ describe("Display.setImageSlides", function () { expect(Display._slides["1"]).toEqual(1); expect($(".slides > section").length).toEqual(2); expect($(".slides > section > img").length).toEqual(2); - expect($(".slides > section > img")[0].getAttribute("src")).toEqual("file://openlp1.jpg") - expect($(".slides > section > img")[1].getAttribute("src")).toEqual("file://openlp2.jpg") + expect($(".slides > section > img")[0].getAttribute("src")).toEqual("file:///openlp1.jpg") + expect($(".slides > section > img")[1].getAttribute("src")).toEqual("file:///openlp2.jpg") expect(Display.reinit).toHaveBeenCalledTimes(1); - expect(Reveal.slide).toHaveBeenCalledWith(0); }); }); @@ -306,7 +304,7 @@ describe("Display.setVideo", function () { }); it("should add a video to the page", function () { - var video = {"file": "file://video.mp4"}; + var video = {"path": "file:///video.mp4"}; spyOn(Display, "clearSlides"); spyOn(Display, "reinit"); @@ -315,7 +313,7 @@ describe("Display.setVideo", function () { expect(Display.clearSlides).toHaveBeenCalledTimes(1); expect($(".slides > section").length).toEqual(1); expect($(".slides > section > video").length).toEqual(1); - expect($(".slides > section > video")[0].src).toEqual("file://video.mp4") + expect($(".slides > section > video")[0].src).toEqual("file:///video.mp4") expect(Display.reinit).toHaveBeenCalledTimes(1); }); });