open-vault/ui/tests/acceptance/policy/show-test.js

24 lines
906 B
JavaScript
Raw Normal View History

import { currentURL } from '@ember/test-helpers';
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
2018-04-03 14:16:57 +00:00
import page from 'vault/tests/pages/policy/show';
import authPage from 'vault/tests/pages/auth';
2018-04-03 14:16:57 +00:00
module('Acceptance | policy/acl/:name', function(hooks) {
setupApplicationTest(hooks);
hooks.beforeEach(function() {
return authPage.login();
});
2018-04-03 14:16:57 +00:00
test('it redirects to list if navigating to root', async function(assert) {
await page.visit({ type: 'acl', name: 'root' });
2018-04-03 14:16:57 +00:00
assert.equal(currentURL(), '/vault/policies/acl', 'navigation to root show redirects you to policy list');
});
test('it navigates to edit when the toggle is clicked', async function(assert) {
await page.visit({ type: 'acl', name: 'default' }).toggleEdit();
2018-04-03 14:16:57 +00:00
assert.equal(currentURL(), '/vault/policy/acl/default/edit', 'toggle navigates to edit page');
});
});