-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
437d50d
commit 81a90ce
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { on } from '@ember/modifier'; | ||
import { click, render, settled } from '@ember/test-helpers'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
|
||
import { cell, resource, resourceFactory } from 'ember-resources'; | ||
|
||
|
||
module('.current and implicit .current', function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('A resource has a current property', async function (assert) { | ||
let change = () => 0; | ||
const Now = resource(() => { | ||
const now = cell(0); | ||
|
||
change = () => now.current++; | ||
|
||
return now; | ||
}); | ||
|
||
await render( | ||
<template> | ||
<out id="implicit">{{Now}}</out> | ||
<out id="explicit">{{Now.current}}</out> | ||
</template> | ||
); | ||
|
||
assert.dom('#implicit').hasText('0'); | ||
assert.dom('explicit').hasText('0'); | ||
|
||
change(); | ||
await settled(); | ||
|
||
assert.dom('#implicit').hasText('1'); | ||
assert.dom('explicit').hasText('1'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters