Commit 6bbf3ac9 authored by Michael Lange's avatar Michael Lange
Browse files

Allow users to escape error pages with the back button

parent 88fea83b
Showing with 28 additions and 0 deletions
+28 -0
......@@ -11,6 +11,7 @@ export default Route.extend({
actions: {
didTransition() {
this.controllerFor('application').set('error', null);
window.scrollTo(0, 0);
},
......
import { find, visit } from 'ember-native-dom-helpers';
import moduleForAcceptance from 'nomad-ui/tests/helpers/module-for-acceptance';
import { test } from 'qunit';
moduleForAcceptance('Acceptance | application errors ', {
beforeEach() {
server.create('agent');
server.create('node');
server.create('job');
},
});
test('transitioning away from an error page resets the global error', function(assert) {
server.pretender.get('/v1/nodes', () => [403, {}, null]);
visit('/nodes');
andThen(() => {
assert.ok(find('.error-message'), 'Application has errored');
});
visit('/jobs');
andThen(() => {
assert.notOk(find('.error-message'), 'Application is no longer in an error state');
});
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment