Skip to content

Commit

Permalink
Avoid assertions for Symbol when not present.
Browse files Browse the repository at this point in the history
Co-authored-by: Godfrey Chan <[email protected]>
  • Loading branch information
rwjblue and chancancode committed Jul 31, 2019
1 parent 253f177 commit 221a8c6
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
EMBER_GLIMMER_SET_COMPONENT_TEMPLATE,
EMBER_MODULE_UNIFICATION,
} from '@ember/canary-features';
import { HAS_NATIVE_SYMBOL } from '@ember/-internals/utils';

import { Component, compile } from '../../utils/helpers';
import { setComponentTemplate, getComponentTemplate } from '../../..';
Expand Down Expand Up @@ -74,9 +75,11 @@ if (EMBER_GLIMMER_SET_COMPONENT_TEMPLATE) {
setComponentTemplate(compile('foo'), 'foo');
}, /Cannot call `setComponentTemplate` on `foo`/);

expectAssertion(() => {
setComponentTemplate(compile('foo'), Symbol('foo'));
}, /Cannot call `setComponentTemplate` on `Symbol\(foo\)`/);
if (HAS_NATIVE_SYMBOL) {
expectAssertion(() => {
setComponentTemplate(compile('foo'), Symbol('foo'));
}, /Cannot call `setComponentTemplate` on `Symbol\(foo\)`/);
}
}

'@test calling it twice on the same object asserts'() {
Expand Down

0 comments on commit 221a8c6

Please sign in to comment.