Test coverage for error page escape hatch links
This commit is contained in:
parent
177a998b1d
commit
f3110f978e
|
@ -31,8 +31,8 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
<div class="error-links">
|
||||
{{#link-to "jobs" class="button is-white"}}Go to Jobs{{/link-to}}
|
||||
{{#link-to "clients" class="button is-white"}}Go to Clients{{/link-to}}
|
||||
{{#link-to "jobs" data-test-error-jobs-link class="button is-white"}}Go to Jobs{{/link-to}}
|
||||
{{#link-to "clients" data-test-error-clients-link class="button is-white"}}Go to Clients{{/link-to}}
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
|
|
|
@ -67,3 +67,28 @@ test('the no leader error state gets its own error message', function(assert) {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
test('error pages include links to the jobs and clients pages', function(assert) {
|
||||
visit('/a/non-existent/page');
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(JobsList.error.isPresent, 'An error is shown');
|
||||
JobsList.error.gotoJobs();
|
||||
});
|
||||
|
||||
andThen(() => {
|
||||
assert.equal(currentURL(), '/jobs', 'Now on the jobs page');
|
||||
assert.notOk(JobsList.error.isPresent, 'The error is gone now');
|
||||
visit('/a/non-existent/page');
|
||||
});
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(JobsList.error.isPresent, 'An error is shown');
|
||||
JobsList.error.gotoClients();
|
||||
});
|
||||
|
||||
andThen(() => {
|
||||
assert.equal(currentURL(), '/clients', 'Now on the clients page');
|
||||
assert.notOk(JobsList.error.isPresent, 'The error is gone now');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -44,6 +44,8 @@ export default create({
|
|||
title: text('[data-test-error-title]'),
|
||||
message: text('[data-test-error-message]'),
|
||||
seekHelp: clickable('[data-test-error-message] a'),
|
||||
gotoJobs: clickable('[data-test-error-jobs-link]'),
|
||||
gotoClients: clickable('[data-test-error-clients-link]'),
|
||||
},
|
||||
|
||||
namespaceSwitcher: {
|
||||
|
|
Loading…
Reference in a new issue