Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
6bbf3ac9
Commit
6bbf3ac9
authored
7 years ago
by
Michael Lange
Browse files
Options
Download
Email Patches
Plain Diff
Allow users to escape error pages with the back button
parent
88fea83b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ui/app/routes/application.js
+1
-0
ui/app/routes/application.js
ui/tests/acceptance/application-errors-test.js
+27
-0
ui/tests/acceptance/application-errors-test.js
with
28 additions
and
0 deletions
+28
-0
ui/app/routes/application.js
+
1
-
0
View file @
6bbf3ac9
...
...
@@ -11,6 +11,7 @@ export default Route.extend({
actions
:
{
didTransition
()
{
this
.
controllerFor
(
'
application
'
).
set
(
'
error
'
,
null
);
window
.
scrollTo
(
0
,
0
);
},
...
...
This diff is collapsed.
Click to expand it.
ui/tests/acceptance/application-errors-test.js
0 → 100644
+
27
-
0
View file @
6bbf3ac9
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
'
);
});
});
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help