Skip to content
Snippets Groups Projects
Commit 65a029cf authored by Matthias Lindinger's avatar Matthias Lindinger Committed by GitHub
Browse files

Merge branch '2.3.0' into fix/missing-german-locales

parents 1509308a 37c3062d
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ language: node_js
sudo: false
node_js:
- '5'
- 'node'
before_install:
- npm install
script:
......
......@@ -220,7 +220,7 @@ module.exports = function(grunt) {
'locales/*/*.json',
'images/*',
'css/*.css',
'css/mirador/**/*.less',
'css/mirador.less/**/*.less',
'index.html'
],
tasks: 'dev_build'
......
paper.install(window);
describe('Overlay', function() {
function getEvent(delta, point, lastPoint, event) {
......@@ -534,4 +532,40 @@ describe('Overlay', function() {
expect(paperScope.tools.length).toEqual(0);
});
describe("When there are two overlays: ", function() {
beforeEach(function() {
var state = new Mirador.SaveController({eventEmitter: this.eventEmitter});
this.overlay2 = new Mirador.Overlay(this.viewerMock, this.windowObjMock.viewer.id, this.windowObjMock.windowId, state, new MockEventEmitter(this.eventEmitter));
this.overlay2.annotationUtils = new AnnotationUtilsStub();
});
afterEach(function() {
delete this.overlay2;
});
it("creates different paperScopes for each overlay", function() {
expect(this.overlay.paperScope._id).not.toEqual(this.overlay2.paperScope._id);
});
it("the global paper object should be set to the most recently instantiated paperScope", function() {
// since overlay2 was created most recently, the global paper object should be set to the paperScope of overlay2
expect(paper._id).toEqual(this.overlay2.paperScope._id);
});
it("correctly sets the global paper object when an overlay's setMouseTool method is called", function(){
// make sure the global paper object is set to the paperScope of overlay2
expect(paper._id).toEqual(this.overlay2.paperScope._id);
// call setMouseTool on the first overlay
this.overlay.setMouseTool();
// make sure the global paper object is set to the paperScope of the first overlay
expect(paper._id).toEqual(this.overlay.paperScope._id);
// call setMouseTool on overlay2 and check the global paper object again
this.overlay2.setMouseTool();
expect(paper._id).toEqual(this.overlay2.paperScope._id);
expect(paper._id).not.toEqual(this.overlay.paperScope._id);
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment