Skip to content

Commit

Permalink
Fix get issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gitKrystan committed Feb 13, 2025
1 parent e2abd4d commit 8b6fe17
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/main/tests/helpers/reactive-context.gts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { get } from '@ember/helper';
import { helper } from '@ember/component/helper';
import type { TestContext } from '@ember/test-helpers';
import { render } from '@ember/test-helpers';
import Component from '@glimmer/component';
Expand Down Expand Up @@ -27,6 +27,10 @@ export async function reactiveContext<T extends Model>(
_fields.push(field.name);
});

const lowPolyGet = helper(([obj, prop]: [obj: TestContext, prop: string]): unknown => {
return obj[prop];
});

// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface ReactiveComponent extends Record<string, string> {}
class ReactiveComponent extends Component {
Expand All @@ -38,7 +42,7 @@ export async function reactiveContext<T extends Model>(
<div class="reactive-context">
<ul>
{{#each this.__allFields as |prop|}}
<li>{{prop}}: {{get this prop}}</li>
<li>{{prop}}: {{lowPolyGet this prop}}</li>
{{/each}}
</ul>
</div>
Expand Down

0 comments on commit 8b6fe17

Please sign in to comment.