diff --git a/addons/api/tests/unit/models/group-test.js b/addons/api/tests/unit/models/group-test.js index 9788c99cd..7b93a0cef 100644 --- a/addons/api/tests/unit/models/group-test.js +++ b/addons/api/tests/unit/models/group-test.js @@ -61,6 +61,7 @@ module('Unit | Model | group', function (hooks) { member_ids: ['123_abc', 'foobar'], version: 1, }); + return { id: '123abc' }; }); const store = this.owner.lookup('service:store'); store.push({ @@ -91,6 +92,7 @@ module('Unit | Model | group', function (hooks) { member_ids: ['1', '3'], version: 1, }); + return { id: '123abc' }; }); const store = this.owner.lookup('service:store'); store.push({ @@ -121,6 +123,7 @@ module('Unit | Model | group', function (hooks) { member_ids: ['3'], version: 1, }); + return { id: '123abc' }; }); const store = this.owner.lookup('service:store'); store.push({ diff --git a/addons/api/tests/unit/models/role-test.js b/addons/api/tests/unit/models/role-test.js index 2548aace8..a3b593e4b 100644 --- a/addons/api/tests/unit/models/role-test.js +++ b/addons/api/tests/unit/models/role-test.js @@ -20,6 +20,7 @@ module('Unit | Model | role', function (hooks) { grant_strings: ['grant1', 'grant2'], version: 1, }); + return { id: '123abc' }; }); const store = this.owner.lookup('service:store'); store.push({ @@ -50,6 +51,7 @@ module('Unit | Model | role', function (hooks) { principal_ids: ['123_abc', 'foobar'], version: 1, }); + return { id: '123abc' }; }); const store = this.owner.lookup('service:store'); store.push({ @@ -85,6 +87,7 @@ module('Unit | Model | role', function (hooks) { principal_ids: ['1', '3'], version: 1, }); + return { id: '123abc' }; } ); const store = this.owner.lookup('service:store'); @@ -121,6 +124,7 @@ module('Unit | Model | role', function (hooks) { principal_ids: ['3'], version: 1, }); + return { id: '123abc' }; } ); const store = this.owner.lookup('service:store'); diff --git a/addons/api/tests/unit/models/target-test.js b/addons/api/tests/unit/models/target-test.js index d7e98bcd8..925e84646 100644 --- a/addons/api/tests/unit/models/target-test.js +++ b/addons/api/tests/unit/models/target-test.js @@ -80,6 +80,7 @@ module('Unit | Model | target', function (hooks) { host_set_ids: ['123_abc', 'foobar'], version: 1, }); + return { id: '123abc' }; }); const store = this.owner.lookup('service:store'); store.push({ @@ -115,6 +116,7 @@ module('Unit | Model | target', function (hooks) { host_set_ids: ['1', '3'], version: 1, }); + return { id: '123abc' }; } ); const store = this.owner.lookup('service:store'); @@ -151,6 +153,7 @@ module('Unit | Model | target', function (hooks) { host_set_ids: ['3'], version: 1, }); + return { id: '123abc' }; } ); const store = this.owner.lookup('service:store'); diff --git a/addons/api/tests/unit/models/user-test.js b/addons/api/tests/unit/models/user-test.js index 75a8f0916..e4ec62301 100644 --- a/addons/api/tests/unit/models/user-test.js +++ b/addons/api/tests/unit/models/user-test.js @@ -14,6 +14,7 @@ module('Unit | Model | user', function (hooks) { account_ids: ['123_abc', 'foobar'], version: 1, }); + return { id: '123abc' }; }); const store = this.owner.lookup('service:store'); store.push({ @@ -44,6 +45,7 @@ module('Unit | Model | user', function (hooks) { account_ids: ['1', '3'], version: 1, }); + return { id: '123abc' }; }); const store = this.owner.lookup('service:store'); store.push({ @@ -74,6 +76,7 @@ module('Unit | Model | user', function (hooks) { account_ids: ['3'], version: 1, }); + return { id: '123abc' }; }); const store = this.owner.lookup('service:store'); store.push({ diff --git a/addons/rose/tests/integration/components/rose/button-test.js b/addons/rose/tests/integration/components/rose/button-test.js index be532a65f..d313e9b0a 100644 --- a/addons/rose/tests/integration/components/rose/button-test.js +++ b/addons/rose/tests/integration/components/rose/button-test.js @@ -7,8 +7,8 @@ module('Integration | Component | rose/button', function (hooks) { setupRenderingTest(hooks); test('it renders', async function (assert) { - await render(hbs`Button 🌈`); - assert.equal(this.element.textContent.trim(), 'Button 🌈'); + await render(hbs`Button`); + assert.equal(this.element.textContent.trim(), 'Button'); }); test('it is type="button" by default', async function (assert) { diff --git a/ui/core/app/components/form/account/password/index.hbs b/ui/core/app/components/form/account/password/index.hbs index 34b7ed0e4..740ea22a5 100644 --- a/ui/core/app/components/form/account/password/index.hbs +++ b/ui/core/app/components/form/account/password/index.hbs @@ -7,7 +7,7 @@ as |form| > diff --git a/ui/core/app/components/form/auth-method/index.hbs b/ui/core/app/components/form/auth-method/index.hbs index ffa39a264..2704507ec 100644 --- a/ui/core/app/components/form/auth-method/index.hbs +++ b/ui/core/app/components/form/auth-method/index.hbs @@ -7,7 +7,7 @@ as |form| > diff --git a/ui/core/app/components/form/host-set/index.hbs b/ui/core/app/components/form/host-set/index.hbs index 76614834c..d457ad0e7 100644 --- a/ui/core/app/components/form/host-set/index.hbs +++ b/ui/core/app/components/form/host-set/index.hbs @@ -8,7 +8,7 @@ > diff --git a/ui/core/app/components/form/host/index.hbs b/ui/core/app/components/form/host/index.hbs index 796496134..b5a931880 100644 --- a/ui/core/app/components/form/host/index.hbs +++ b/ui/core/app/components/form/host/index.hbs @@ -8,7 +8,7 @@ > diff --git a/ui/core/app/components/form/target/index.hbs b/ui/core/app/components/form/target/index.hbs index 20627adef..afbfc76b0 100644 --- a/ui/core/app/components/form/target/index.hbs +++ b/ui/core/app/components/form/target/index.hbs @@ -8,7 +8,7 @@ > diff --git a/ui/core/tests/acceptance/accounts/change-password-test.js b/ui/core/tests/acceptance/accounts/change-password-test.js index 27a28ba3d..b474be688 100644 --- a/ui/core/tests/acceptance/accounts/change-password-test.js +++ b/ui/core/tests/acceptance/accounts/change-password-test.js @@ -66,10 +66,12 @@ module('Acceptance | accounts | change password', function (hooks) { test('can change password for account', async function (assert) { assert.expect(2); - this.server.post('/accounts/:id', (_, { requestBody }) => { + this.server.post('/accounts/:idMethod', (_, { params: { idMethod }, requestBody }) => { const attrs = JSON.parse(requestBody); assert.equal(attrs.current_password, 'current password', 'current password is provided'); assert.equal(attrs.new_password, 'new password', 'new password is provided'); + const id = idMethod.split(':')[0]; + return { id }; }); await visit(urls.changePassword); await fillIn('[name="currentPassword"]', 'current password'); diff --git a/ui/core/tests/acceptance/accounts/set-password-test.js b/ui/core/tests/acceptance/accounts/set-password-test.js index d03dff3d1..442f468ee 100644 --- a/ui/core/tests/acceptance/accounts/set-password-test.js +++ b/ui/core/tests/acceptance/accounts/set-password-test.js @@ -61,9 +61,11 @@ module('Acceptance | accounts | set password', function (hooks) { test('can set a new password for account', async function (assert) { assert.expect(1); - this.server.post('/accounts/:id', (_, { requestBody }) => { + this.server.post('/accounts/:idMethod', (_, { params: { idMethod }, requestBody }) => { const attrs = JSON.parse(requestBody); assert.equal(attrs.password, 'update password', 'new password is set'); + const id = idMethod.split(':')[0]; + return { id }; }); await visit(urls.setPassword); await fillIn('[name="password"]', 'update password'); diff --git a/ui/core/tests/acceptance/roles/grants-test.js b/ui/core/tests/acceptance/roles/grants-test.js index e767928fb..f7391742b 100644 --- a/ui/core/tests/acceptance/roles/grants-test.js +++ b/ui/core/tests/acceptance/roles/grants-test.js @@ -58,9 +58,11 @@ module('Acceptance | roles | grants', function (hooks) { test('update a grant', async function(assert) { assert.expect(1); - this.server.post('/roles/:id', (_, { requestBody }) => { + this.server.post('/roles/:idMethod', (_, { params: { idMethod }, requestBody }) => { const attrs = JSON.parse(requestBody); assert.equal(attrs.grant_strings[0], 'id=123,action=delete', "A grant is updated"); + const id = idMethod.split(':')[0]; + return { id }; }); await visit(urls.grants); await fillIn(`${grantsForm} [name="grant"]`, 'id=123,action=delete'); @@ -90,7 +92,7 @@ module('Acceptance | roles | grants', function (hooks) { ); }); await visit(urls.grants); - assert.equal(findAll(`${grantsForm} [name="grant"]`).length, + assert.equal(findAll(`${grantsForm} [name="grant"]`).length, grantsCount); await fillIn(`${grantsForm} [name="grant"]`, 'id=123,action=delete'); await click('.rose-form-actions [type="submit"]:not(:disabled)'); @@ -99,9 +101,11 @@ module('Acceptance | roles | grants', function (hooks) { test('create a grant', async function(assert) { assert.expect(1); - this.server.post('/roles/:id', (_, { requestBody }) => { + this.server.post('/roles/:idMethod', (_, { params: { idMethod }, requestBody }) => { const attrs = JSON.parse(requestBody); assert.equal(attrs.grant_strings.length, grantsCount + 1, "A grant is created"); + const id = idMethod.split(':')[0]; + return { id }; }); await visit(urls.grants); await fillIn(`${newGrantForm} [name="grant"]`, 'id=123,action=delete'); @@ -133,7 +137,7 @@ module('Acceptance | roles | grants', function (hooks) { ); }); await visit(urls.grants); - assert.equal(findAll(`${grantsForm} [name="grant"]`).length, + assert.equal(findAll(`${grantsForm} [name="grant"]`).length, grantsCount); await fillIn(`${newGrantForm} [name="grant"]`, 'id=123,action=delete'); await click(`${newGrantForm} [type="submit"]:not(:disabled)`); @@ -146,7 +150,7 @@ module('Acceptance | roles | grants', function (hooks) { await visit(urls.grants); await click(`${grantsForm} button:not([type="submit"])`); await click('.rose-form-actions [type="submit"]:not(:disabled)'); - assert.equal(findAll(`${grantsForm} [name="grant"]`).length, + assert.equal(findAll(`${grantsForm} [name="grant"]`).length, grantsCount - 1); }); @@ -173,7 +177,7 @@ module('Acceptance | roles | grants', function (hooks) { ); }); await visit(urls.grants); - assert.equal(findAll(`${grantsForm} [name="grant"]`).length, + assert.equal(findAll(`${grantsForm} [name="grant"]`).length, grantsCount); await click(`${grantsForm} button:not([type="submit"])`); await click('.rose-form-actions [type="submit"]:not(:disabled)'); diff --git a/ui/core/tests/integration/components/bread-crumbs-test.js b/ui/core/tests/integration/components/bread-crumbs-test.js deleted file mode 100644 index 601741311..000000000 --- a/ui/core/tests/integration/components/bread-crumbs-test.js +++ /dev/null @@ -1,53 +0,0 @@ -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { render, find, findAll } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; - -module('Integration | Component | bread-crumbs', function (hooks) { - setupRenderingTest(hooks); - - test('it renders', async function (assert) { - this.set('breadCrumbs', [{ label: 'Level 1' }]); - - await render(hbs``); - // Default index route - assert.ok(find('.rose-nav-breadcrumbs a').href.match(/#$/)); - assert.equal(find('.rose-nav-breadcrumbs').textContent.trim(), 'Level 1'); - }); - - test('it renders with model', async function (assert) { - let store = this.owner.lookup('service:store'); - let scope = store.createRecord('scope'); - - this.set('breadCrumbs', [ - { - label: 'Level 1', - path: 'scopes.scope', - model: scope, - }, - ]); - - await render(hbs``); - assert.equal(find('.rose-nav-breadcrumbs').textContent.trim(), 'Level 1'); - }); - - test('it renders multiple breadCrumbs', async function (assert) { - this.set('breadCrumbs', [ - { - label: 'Level 1', - }, - { - label: 'Level 2', - }, - { - label: 'Level 3', - }, - ]); - - await render(hbs``); - assert.equal(findAll('a').length, 3); - assert.equal(findAll('a')[0].textContent.trim(), 'Level 1'); - assert.equal(findAll('a')[1].textContent.trim(), 'Level 2'); - assert.equal(findAll('a')[2].textContent.trim(), 'Level 3'); - }); -});