Skip to content

Commit

Permalink
sadness
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jun 7, 2019
1 parent 72c1e61 commit 9487bd7
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions packages/ember/tests/routing/route_controller_integration_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (EMBER_METAL_TRACKED_PROPERTIES && EMBER_NATIVE_DECORATOR_SUPPORT) {
moduleFor(
'Route <-> Controller Integration',
class extends ApplicationTestCase {
async ['@test properties that autotrack the model update when the model changes'](assert) {
['@test properties that autotrack the model update when the model changes'](assert) {
assert.expect(2);

this.router.map(function() {
Expand All @@ -33,19 +33,23 @@ if (EMBER_METAL_TRACKED_PROPERTIES && EMBER_NATIVE_DECORATOR_SUPPORT) {
this.add('controller:home', HomeController);
this.addTemplate('home', '<h3 class="derivedProperty">{{this.derivedProperty}}</h3>');

await this.visit('/home/2');
assert.equal(
document.querySelector('h3').innerText,
'2',
'the derived property matches the id'
);

await this.visit('/home/3');
assert.equal(
document.querySelector('h3').innerText,
'3',
'the derived property matches the id'
);
return this.visit('/home/2')
.then(() => {
assert.equal(
document.querySelector('h3').innerText,
'2',
'the derived property matches the id'
);
})
.then(() => {
return this.visit('/home/3').then(() => {
assert.equal(
document.querySelector('h3').innerText,
'3',
'the derived property matches the id'
);
});
});
}
}
);
Expand Down

0 comments on commit 9487bd7

Please sign in to comment.