Skip to content

Commit 0f4102a

Browse files
committed
Better scenario test
1 parent d5a1212 commit 0f4102a

1 file changed

Lines changed: 26 additions & 15 deletions

File tree

smoke-tests/scenarios/basic-test.ts

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -378,28 +378,39 @@ function basicTest(scenarios: Scenarios, appName: string) {
378378
import { setupRenderingTest } from 'ember-qunit';
379379
import { render } from '@ember/test-helpers';
380380
381-
import Component from '@glimmer/component';
382-
383-
class EqDemo extends Component {
384-
<template>
385-
<span data-test="eq">{{if (eq @a @b) "yes" "no"}}</span>
386-
<span data-test="neq">{{if (neq @a @b) "yes" "no"}}</span>
387-
</template>
388-
}
389-
390381
module('{{eq}} / {{neq}} as keywords', function(hooks) {
391382
setupRenderingTest(hooks);
392383
393-
test('eq returns true for equal values', async function(assert) {
394-
await render(<template><EqDemo @a={{1}} @b={{1}} /></template>);
384+
test('it works', async function(assert) {
385+
let a = 1;
386+
let b = 1;
387+
388+
await render(
389+
<template>
390+
<span data-test="eq">{{if (eq a b) "yes" "no"}}</span>
391+
<span data-test="neq">{{if (neq a b) "yes" "no"}}</span>
392+
</template>
393+
);
394+
395395
assert.dom('[data-test="eq"]').hasText('yes');
396396
assert.dom('[data-test="neq"]').hasText('no');
397397
});
398398
399-
test('eq returns false for unequal values', async function(assert) {
400-
await render(<template><EqDemo @a={{1}} @b={{2}} /></template>);
401-
assert.dom('[data-test="eq"]').hasText('no');
402-
assert.dom('[data-test="neq"]').hasText('yes');
399+
test('can be shadowed', async function (assert) {
400+
let a = 1;
401+
let b = 1;
402+
let eq = () => 'surprise:eq';
403+
let neq = () => 'surprise:neq';
404+
405+
await render(
406+
<template>
407+
<span data-test="eq">{{if (eq a b) "yes" "no"}}</span>
408+
<span data-test="neq">{{if (neq a b) "yes" "no"}}</span>
409+
</template>
410+
);
411+
412+
assert.dom('[data-test="eq"]').hasText('surprise:eq');
413+
assert.dom('[data-test="neq"]').hasText('surprise:neq');
403414
});
404415
});
405416
`,

0 commit comments

Comments
 (0)