Skip to content

Commit

Permalink
Tests for coreLayout.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ericman314 committed Oct 28, 2018
1 parent 3f9bc90 commit 3c18d0a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions server/tests/classes/coreLayout.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import CoreLayout from '../../src/classes/coreLayout';

describe('CoreLayout', () => {

test('should throw if called without the \'new\' operator', () => {
expect(() => { const c = CoreLayout(); }).toThrow(/Cannot call a class as a function/);
});

describe('constructor', () => {
test('should set default parameters', () => {
const cl = new CoreLayout();
expect(cl.id).toEqual(expect.stringMatching(/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/));
expect(cl.class).toBe('CoreLayout');
expect(cl.name).toBe('default');
});
});

});

0 comments on commit 3c18d0a

Please sign in to comment.