Skip to content

Commit

Permalink
test(shape): Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiklor committed May 12, 2016
1 parent a90bc9e commit 8628a9b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/unit/Shape.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ describe('Shape', () => {
it('Should properly get/set background', () => {
const shape = new Shape(cursor);

assert.notOk(shape.getBackground());
assert.equal(shape.getBackground(), 'none');
assert.instanceOf(shape.setBackground('red'), Shape);
assert.equal(shape.getBackground(), 'red');
});

it('Should properly get/set foreground', () => {
const shape = new Shape(cursor);

assert.notOk(shape.getBackground());
assert.equal(shape.getForeground(), 'none');
assert.instanceOf(shape.setForeground('yellow'), Shape);
assert.equal(shape.getForeground(), 'yellow');
});
Expand All @@ -122,8 +122,8 @@ describe('Shape', () => {
height: 5,
x: 10,
y: 10,
background: false,
foreground: false
background: 'none',
foreground: 'none'
}
});
});
Expand Down Expand Up @@ -158,14 +158,14 @@ describe('Shape', () => {
const shape = new Shape(cursor);
const json = shape.toJSON();

assert.equal(json, '{"type":"Shape","options":{"text":"","width":15,"height":5,"x":10,"y":10,"background":false,"foreground":false}}');
assert.equal(json, '{"type":"Shape","options":{"text":"","width":15,"height":5,"x":10,"y":10,"background":"none","foreground":"none"}}');
});

it('Should properly serialize shape to JSON with custom options', () => {
const shape = new Shape(cursor, {text: 'test', x: 0, y: 0, width: 30, height: 50});
const json = shape.toJSON();

assert.equal(json, '{"type":"Shape","options":{"text":"test","width":30,"height":50,"x":0,"y":0,"background":false,"foreground":false}}');
assert.equal(json, '{"type":"Shape","options":{"text":"test","width":30,"height":50,"x":0,"y":0,"background":"none","foreground":"none"}}');
});

it('Should properly create Shape instance from static create()', () => {
Expand Down Expand Up @@ -225,7 +225,7 @@ describe('Shape', () => {
assert.equal(shape.getHeight(), 50);
assert.equal(shape.getX(), 1);
assert.equal(shape.getY(), 1);
assert.notOk(shape.getBackground());
assert.notOk(shape.getForeground());
assert.equal(shape.getBackground(), 'none');
assert.equal(shape.getForeground(), 'none');
});
});

0 comments on commit 8628a9b

Please sign in to comment.