Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
tests: add 2 edge cases for single val

specs: add 2 cases without block field
  • Loading branch information
qfox authored and skad0 committed Aug 2, 2016
1 parent 3ef0028 commit 79a4a3d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/assign.test.js
Expand Up @@ -138,6 +138,20 @@ test('should use modVal from scope if nothing given', t => {
{ entity: { block: 'sb', modName: 'sm', modVal: 'sv' }, tech: null });
});

test('should not use modVal from scope if only block given', t => {
t.deepEqual(assign(
{ entity: { modVal: 'sv' } },
{ entity: { block: 'sb' } }),
{ entity: { block: 'sb' }, tech: null });
});

test('should not use modVal from scope if only elem given', t => {
t.deepEqual(assign(
{ entity: { modVal: 'sv' } },
{ entity: { block: 'sb', elem: 'se' } }),
{ entity: { block: 'sb', elem: 'se' }, tech: null });
});

// Tech related specs

test('assign should support tech grabbing from scope', t => {
Expand Down
1 change: 1 addition & 0 deletions test/normalize2/elems-mods.test.js
Expand Up @@ -20,6 +20,7 @@ test('should support elem as object and mod', t => {
{ entity: { block: 'block', elem: 'elem', modName: 'mod1', modVal: 'v1' }, tech: undefined }
]);
});

test('should support elem of elem as array mods', t => {
const decl = {
block: 'block',
Expand Down

0 comments on commit 79a4a3d

Please sign in to comment.