This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
scratch-html5/test/unit/stageSpec.js
2014-04-09 01:18:14 -07:00

55 lines
1.6 KiB
JavaScript

/* jasmine specs for Stage.js go here */
describe('Stage', function() {
var stage;
beforeEach(function() {
stage = Stage;
});
describe('Initialized variables', function() {
var initStage, lineCanvas;
beforeEach(function() {
spyOn(Sprite, "call");
initStage = new stage(sensingData);
});
describe('Stage Variables', function() {
it('should have a z variable', function() {
expect(initStage.z).toBe(-2);
});
it('should have a penLayerLoaded variable', function() {
expect(initStage.penLayerLoaded).toBe(false);
});
it('should have a lineCanvas element', function() {
expect(initStage.lineCanvas).toBeDefined();
});
it('should have a lineCanvas width', function() {
expect(initStage.lineCanvas.width).toBe(480);
});
it('should have a lineCanvas height', function() {
expect(initStage.lineCanvas.height).toBe(360);
});
it('should have a lineCache variable', function() {
expect(initStage.lineCache).toBeDefined();
});
it('should have a isStage variable', function() {
expect(initStage.isStage).toBe(true);
});
it('should have an askAnswer variable', function() {
expect(initStage.askAnswer).toBe("");
});
it('should have called Sprite.call', function() {
expect(Sprite.call).toHaveBeenCalled();
});
});
});
});