chore: 🤖 remove deprecation warnings from ui/core

This commit is contained in:
Randall Morey committed 2020-10-06 11:39:41 -04:00
1 parent 67b105af81
commit dbf7e252b3
9 files changed
+21 -66

No files matched your search

@@ -7,7 +7,7 @@
as |form|
>
<form.input
@value={{t (concat 'resources.account.types.' @model.type)}}
@value={{@model.type}}
@label={{t "form.type.label"}}
readonly={{true}}
@disabled={{true}} />
@@ -7,7 +7,7 @@
as |form|
>
<form.input
@value={{t (concat 'resources.auth-method.types.' @model.type)}}
@value={{@model.type}}
@label={{t "form.type.label"}}
readonly={{true}}
@disabled={{true}} />
@@ -8,7 +8,7 @@
>
<form.input
@value={{t (concat 'resources.host-set.types.' @model.type)}}
@value={{@model.type}}
@label={{t "form.type.label"}}
readonly={{true}}
@disabled={{true}} />
+1 -1
View File
@@ -8,7 +8,7 @@
>
<form.input
@value={{t (concat 'resources.host.types.' @model.type)}}
@value={{@model.type}}
@label={{t "form.type.label"}}
readonly={{true}}
@disabled={{true}} />
+1 -1
View File
@@ -8,7 +8,7 @@
>
<form.input
@value={{t (concat 'resources.target.types.' @model.type)}}
@value={{@model.type}}
@label={{t "form.type.label"}}
readonly={{true}}
@disabled={{true}} />
@@ -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');
@@ -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');
+10 -6
View File
@@ -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)');
@@ -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`<BreadCrumbs @breadCrumbs={{this.breadCrumbs}} />`);
// 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`<BreadCrumbs @breadCrumbs={{this.breadCrumbs}} />`);
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`<BreadCrumbs @breadCrumbs={{this.breadCrumbs}} />`);
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');
});
});