-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
6 changed files
with
74 additions
and
5 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Controller from '@ember/controller'; | ||
import { action } from '@ember/object'; | ||
// import { reject } from 'rsvp'; | ||
|
||
export default class ApplicationController extends Controller { | ||
|
||
// @action | ||
// doSomethingAsyncThatFails() { | ||
// return reject('failed'); | ||
// } | ||
|
||
@action | ||
async doSomethingAsyncThatFails() { | ||
throw new Error('failed') | ||
} | ||
|
||
} |
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,4 @@ | ||
import Route from '@ember/routing/route'; | ||
|
||
export default class ApplicationRoute extends Route { | ||
} |
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 |
---|---|---|
@@ -1,5 +1 @@ | ||
{{!-- The following component displays Ember's default welcome message. --}} | ||
<WelcomePage /> | ||
{{!-- Feel free to remove this! --}} | ||
|
||
{{outlet}} | ||
<button type="button" {{on "click" this.doSomethingAsyncThatFails}}>Do something async that fails</button> |
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,29 @@ | ||
import { module, test } from 'qunit'; | ||
import { visit, click } from '@ember/test-helpers'; | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
import { setupOnerror, resetOnerror } from '@ember/test-helpers'; | ||
|
||
module('Acceptance | application', function(hooks) { | ||
setupApplicationTest(hooks); | ||
|
||
test('visiting /', async function(assert) { | ||
assert.expect(0); | ||
|
||
// We know the application will error in this test, but that's OK, | ||
// we want to specifically test the error state so that the test | ||
// doesn't fail. | ||
setupOnerror(error => { | ||
if (error === 'failed') { | ||
return; | ||
} | ||
|
||
throw error; | ||
}); | ||
|
||
await visit('/'); | ||
|
||
await click('button'); | ||
|
||
resetOnerror(); | ||
}); | ||
}); |
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,12 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
module('Unit | Controller | application', function(hooks) { | ||
setupTest(hooks); | ||
|
||
// TODO: Replace this with your real tests. | ||
test('it exists', function(assert) { | ||
let controller = this.owner.lookup('controller:application'); | ||
assert.ok(controller); | ||
}); | ||
}); |
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,11 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
module('Unit | Route | application', function(hooks) { | ||
setupTest(hooks); | ||
|
||
test('it exists', function(assert) { | ||
let route = this.owner.lookup('route:application'); | ||
assert.ok(route); | ||
}); | ||
}); |