Skip to content

Commit

Permalink
Merge pull request #1055 from glimmerjs/rename-test-file
Browse files Browse the repository at this point in the history
bugfix: -test not -tests
  • Loading branch information
chadhietala authored Mar 9, 2020
2 parents 117743c + 06afc08 commit c9756de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,16 @@ export class EmberishCurlyComponent {
return c;
}

init() {}

constructor() {
this._guid = `${GUID++}`;
this.init();
}

set(key: string, value: unknown) {
(this as any)[key] = value;
dirty(this.dirtinessTag);
}

setProperties(dict: Dict) {
Expand Down Expand Up @@ -161,7 +165,6 @@ export class EmberishCurlyComponentManager
args: VMArguments
): Option<PreparedArguments> {
const { positionalParams } = state.ComponentClass || EmberishCurlyComponent;

if (typeof positionalParams === 'string') {
if (args.named.has(positionalParams)) {
if (args.positional.length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,17 +376,17 @@ QUnit.test('dynamic attribute bindings', assert => {

assertEmberishElement('div', { style: 'color: red;' }, `Hello. It's me.`);

fooBarInstance.style = 'color: green;';
fooBarInstance.set('style', 'color: green;');
rerender();

assertEmberishElement('div', { style: 'color: green;' }, `Hello. It's me.`);

fooBarInstance.style = null;
fooBarInstance.set('style', null);
rerender();

assertEmberishElement('div', {}, `Hello. It's me.`);

fooBarInstance.style = 'color: red;';
fooBarInstance.set('style', 'color: red;');
rerender();

assertEmberishElement('div', { style: 'color: red;' }, `Hello. It's me.`);
Expand Down Expand Up @@ -851,7 +851,7 @@ QUnit.test(

QUnit.test('static arbitrary number of positional parameters', function() {
class SampleComponent extends EmberishCurlyComponent {
static positionalParams = ['names'];
static positionalParams = 'names';
}

registerEmberishCurlyComponent(
Expand Down Expand Up @@ -948,7 +948,7 @@ QUnit.test('can use hash parameter instead of positional param', function() {

QUnit.test('dynamic arbitrary number of positional parameters', function() {
class SampleComponent extends EmberishCurlyComponent {
static positionalParams = ['n'];
static positionalParams = 'n';
}

registerEmberishCurlyComponent(
Expand Down Expand Up @@ -1395,18 +1395,6 @@ QUnit.test(`Ensure components can be invoked`, function() {
equalsElement(view.element, 'div', {}, 'hi!');
});

QUnit.test(`Glimmer component with element modifier`, function(assert) {
registerEmberishGlimmerComponent(context.registry, 'NonBlock', null, ` <div>In layout</div> `);

assert.throws(
() => {
appendViewFor('<NonBlock {{action}} />');
},
new Error('Compile Error: Element modifiers are not allowed in components'),
'should throw error'
);
});

QUnit.test('Custom element with element modifier', function(assert) {
assert.expect(0);

Expand Down Expand Up @@ -2014,7 +2002,7 @@ QUnit.test('deeply nested destructions', function(assert) {
);

appendViewFor(
`{{#each list key='@primitive' as |item|}}<DestroyMe1 @item={{item}}>{{#destroy-me2 from="root" item=item}}{{/destroy-me2}}</DestroyMe1>{{/each}}`,
`{{#each list key='@identity' as |item|}}<DestroyMe1 @item={{item}}>{{#destroy-me2 from="root" item=item}}{{/destroy-me2}}</DestroyMe1>{{/each}}`,
{ list: [1, 2, 3, 4, 5] }
);

Expand Down

0 comments on commit c9756de

Please sign in to comment.