Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

Commit 06afc08

Browse files
committed
bugfix: fix failing emberish tests
1 parent 8063bc4 commit 06afc08

2 files changed

Lines changed: 10 additions & 19 deletions

File tree

packages/@glimmer/integration-tests/lib/components/emberish-curly.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,16 @@ export class EmberishCurlyComponent {
6868
return c;
6969
}
7070

71+
init() {}
72+
7173
constructor() {
7274
this._guid = `${GUID++}`;
75+
this.init();
7376
}
7477

7578
set(key: string, value: unknown) {
7679
(this as any)[key] = value;
80+
dirty(this.dirtinessTag);
7781
}
7882

7983
setProperties(dict: Dict) {
@@ -161,7 +165,6 @@ export class EmberishCurlyComponentManager
161165
args: VMArguments
162166
): Option<PreparedArguments> {
163167
const { positionalParams } = state.ComponentClass || EmberishCurlyComponent;
164-
165168
if (typeof positionalParams === 'string') {
166169
if (args.named.has(positionalParams)) {
167170
if (args.positional.length === 0) {

packages/@glimmer/integration-tests/test/ember-component-test.ts

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -376,17 +376,17 @@ QUnit.test('dynamic attribute bindings', assert => {
376376

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

379-
fooBarInstance.style = 'color: green;';
379+
fooBarInstance.set('style', 'color: green;');
380380
rerender();
381381

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

384-
fooBarInstance.style = null;
384+
fooBarInstance.set('style', null);
385385
rerender();
386386

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

389-
fooBarInstance.style = 'color: red;';
389+
fooBarInstance.set('style', 'color: red;');
390390
rerender();
391391

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

852852
QUnit.test('static arbitrary number of positional parameters', function() {
853853
class SampleComponent extends EmberishCurlyComponent {
854-
static positionalParams = ['names'];
854+
static positionalParams = 'names';
855855
}
856856

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

949949
QUnit.test('dynamic arbitrary number of positional parameters', function() {
950950
class SampleComponent extends EmberishCurlyComponent {
951-
static positionalParams = ['n'];
951+
static positionalParams = 'n';
952952
}
953953

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

1398-
QUnit.test(`Glimmer component with element modifier`, function(assert) {
1399-
registerEmberishGlimmerComponent(context.registry, 'NonBlock', null, ` <div>In layout</div> `);
1400-
1401-
assert.throws(
1402-
() => {
1403-
appendViewFor('<NonBlock {{action}} />');
1404-
},
1405-
new Error('Compile Error: Element modifiers are not allowed in components'),
1406-
'should throw error'
1407-
);
1408-
});
1409-
14101398
QUnit.test('Custom element with element modifier', function(assert) {
14111399
assert.expect(0);
14121400

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

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

0 commit comments

Comments
 (0)