chore: 🤖 apply prettier formatting to ui projects
This commit is contained in:
160 files changed
+1042
-707
No files matched your search
@@ -2,10 +2,8 @@ import BreadCrumbsComponent from 'ember-breadcrumbs/components/bread-crumbs';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class crumbs extends BreadCrumbsComponent {
|
||||
|
||||
// =services
|
||||
|
||||
@service session;
|
||||
@service scope;
|
||||
|
||||
}
|
||||
@@ -54,8 +54,7 @@ export default class ErrorMessageComponent extends MessageComponent {
|
||||
@computed('args.status')
|
||||
get messageCode() {
|
||||
let messageCode = this.args.status;
|
||||
if(!statuses.includes(messageCode)) messageCode = 'unknown';
|
||||
if (!statuses.includes(messageCode)) messageCode = 'unknown';
|
||||
return messageCode;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import { action } from '@ember/object';
|
||||
import { run } from '@ember/runloop';
|
||||
|
||||
export default class FormAccountPasswordChangePasswordIndexComponent extends Component {
|
||||
|
||||
// =properties
|
||||
|
||||
/**
|
||||
@@ -69,5 +68,4 @@ export default class FormAccountPasswordChangePasswordIndexComponent extends Com
|
||||
this.resetPasswords();
|
||||
fn();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@ export default class FormRoleGrantsComponent extends Component {
|
||||
*/
|
||||
@computed('args.model.grant_strings.[]')
|
||||
get grants() {
|
||||
return this.args.model.grant_strings.map(value => ({ value }));
|
||||
return this.args.model.grant_strings.map((value) => ({ value }));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ export default class FormRoleGrantsComponent extends Component {
|
||||
*/
|
||||
@computed('grants.@each.value')
|
||||
get grantStrings() {
|
||||
return this.grants.map(obj => obj.value);
|
||||
return this.grants.map((obj) => obj.value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,9 @@ export default class FormRoleGrantsComponent extends Component {
|
||||
*/
|
||||
@computed('args.model.{store,grant_scope_id}')
|
||||
get selectedGrantScope() {
|
||||
return this.args.model.store
|
||||
.peekRecord('scope', this.args.model.grant_scope_id);
|
||||
return this.args.model.store.peekRecord(
|
||||
'scope',
|
||||
this.args.model.grant_scope_id
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import { action } from '@ember/object';
|
||||
* action. Useful for rendering confirm modals and awaiting user action.
|
||||
*/
|
||||
export default class PendingConfirmationsComponent extends Component {
|
||||
|
||||
// =services
|
||||
|
||||
@service confirm;
|
||||
@@ -36,5 +35,4 @@ export default class PendingConfirmationsComponent extends Component {
|
||||
confirmation.dismiss();
|
||||
return confirmation;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,6 @@ export default class ScopesScopeAuthenticateController extends Controller {
|
||||
return [
|
||||
...this.model.scopes.filter((scope) => scope.id === 'global'),
|
||||
...this.model.scopes.filter((scope) => scope.id !== 'global'),
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,11 +13,14 @@ export function confirm(confirmationTextKey) {
|
||||
const confirmService = owner.lookup('service:confirm');
|
||||
const intl = owner.lookup('service:intl');
|
||||
const text = intl.t(confirmationTextKey);
|
||||
return confirmService.confirm(text)
|
||||
// If user confirmed, execute the decorated method
|
||||
.then(() => method.apply(this, arguments))
|
||||
// If the user denied, gracefully handle promise rejection with no-op
|
||||
.catch((e) => e);
|
||||
return (
|
||||
confirmService
|
||||
.confirm(text)
|
||||
// If user confirmed, execute the decorated method
|
||||
.then(() => method.apply(this, arguments))
|
||||
// If the user denied, gracefully handle promise rejection with no-op
|
||||
.catch((e) => e)
|
||||
);
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -14,9 +14,10 @@ export function notifySuccess(notification) {
|
||||
const owner = getOwner(this);
|
||||
const notifyService = owner.lookup('service:notify');
|
||||
const intlService = owner.lookup('service:intl');
|
||||
const candidateKey = (typeof notification === 'function')
|
||||
? notification.apply(this, arguments)
|
||||
: notification;
|
||||
const candidateKey =
|
||||
typeof notification === 'function'
|
||||
? notification.apply(this, arguments)
|
||||
: notification;
|
||||
// As of now, we only use translated strings for notifications,
|
||||
// but this code would support both translated and arbitrary strings.
|
||||
// const text = intlService.exists(candidateKey)
|
||||
@@ -27,7 +28,7 @@ export function notifySuccess(notification) {
|
||||
notifyService.success(text);
|
||||
return value;
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,7 +44,7 @@ export function notifySuccess(notification) {
|
||||
* @param {object} options
|
||||
* @param {object} options.catch - defaults to false
|
||||
*/
|
||||
export function notifyError(notification, options={ catch: false }) {
|
||||
export function notifyError(notification, options = { catch: false }) {
|
||||
return function (_target, _propertyKey, desc) {
|
||||
const method = desc.value;
|
||||
desc.value = async function () {
|
||||
@@ -53,7 +54,6 @@ export function notifyError(notification, options={ catch: false }) {
|
||||
try {
|
||||
return await method.apply(this, arguments);
|
||||
} catch (error) {
|
||||
|
||||
// As of now all error notifications pass a function, but this code
|
||||
// could support either a function or a string.
|
||||
// const candidateKey = (typeof notification === 'function')
|
||||
@@ -77,5 +77,5 @@ export function notifyError(notification, options={ catch: false }) {
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -14,7 +14,7 @@ export default {
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
hour12: false
|
||||
hour12: false,
|
||||
},
|
||||
hhmmss: {
|
||||
hour: 'numeric',
|
||||
|
||||
@@ -2,15 +2,18 @@ import { helper } from '@ember/component/helper';
|
||||
import { assert } from '@ember/debug';
|
||||
import config from '../config/environment';
|
||||
|
||||
export default helper(function docUrl(params/*, hash*/) {
|
||||
export default helper(function docUrl(params /*, hash*/) {
|
||||
const baseURL = config.documentation.baseURL;
|
||||
const docKey = params[0] || '';
|
||||
const configuredPath = config.documentation.topics[docKey];
|
||||
if (docKey) {
|
||||
assert(`
|
||||
assert(
|
||||
`
|
||||
Documentation for "${docKey}" could not be found. Please ensure that
|
||||
this key exists under "documentation" in your app config.
|
||||
`, configuredPath);
|
||||
`,
|
||||
configuredPath
|
||||
);
|
||||
}
|
||||
const path = configuredPath || '';
|
||||
return `${baseURL}${path}`;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { helper } from '@ember/component/helper';
|
||||
|
||||
export default helper(function formatDateIsoHuman(params/*, hash*/) {
|
||||
return params[0].toISOString()
|
||||
export default helper(function formatDateIsoHuman(params /*, hash*/) {
|
||||
return params[0]
|
||||
.toISOString()
|
||||
.replace('T', ' ')
|
||||
.replace(/\.\d*Z/, '');
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
import { helper } from '@ember/component/helper';
|
||||
|
||||
export default helper(function formatDateIso(params/*, hash*/) {
|
||||
export default helper(function formatDateIso(params /*, hash*/) {
|
||||
return params[0].toISOString();
|
||||
});
|
||||
@@ -6,7 +6,6 @@ import { inject as service } from '@ember/service';
|
||||
* service's `isLoading` attribute.
|
||||
*/
|
||||
export default class extends Helper {
|
||||
|
||||
// =services
|
||||
|
||||
@service loading;
|
||||
@@ -20,5 +19,4 @@ export default class extends Helper {
|
||||
compute() {
|
||||
return this.loading.isLoading;
|
||||
}
|
||||
|
||||
}
|
||||
+12
-12
@@ -13,7 +13,7 @@ Router.map(function () {
|
||||
this.route('method', { path: ':auth_method_id' });
|
||||
});
|
||||
|
||||
this.route('scopes', function() {});
|
||||
this.route('scopes', function () {});
|
||||
this.route('edit');
|
||||
this.route('new');
|
||||
|
||||
@@ -54,26 +54,26 @@ Router.map(function () {
|
||||
this.route('new');
|
||||
});
|
||||
|
||||
this.route('sessions', function() {});
|
||||
this.route('sessions', function () {});
|
||||
|
||||
this.route('targets', function() {
|
||||
this.route('target', { path: ':target_id' }, function() {
|
||||
this.route('host-sets', function() {});
|
||||
this.route('targets', function () {
|
||||
this.route('target', { path: ':target_id' }, function () {
|
||||
this.route('host-sets', function () {});
|
||||
this.route('add-host-sets');
|
||||
});
|
||||
this.route('new');
|
||||
});
|
||||
|
||||
this.route('host-catalogs', function() {
|
||||
this.route('host-catalogs', function () {
|
||||
this.route('new');
|
||||
this.route('host-catalog', { path: ':host_catalog_id' }, function() {
|
||||
this.route('hosts', function() {
|
||||
this.route('host-catalog', { path: ':host_catalog_id' }, function () {
|
||||
this.route('hosts', function () {
|
||||
this.route('new');
|
||||
this.route('host', { path: ':host_id' }, function() {});
|
||||
this.route('host', { path: ':host_id' }, function () {});
|
||||
});
|
||||
this.route('host-sets', function() {
|
||||
this.route('host-sets', function () {
|
||||
this.route('new');
|
||||
this.route('host-set', { path: ':host_set_id' }, function() {
|
||||
this.route('host-set', { path: ':host_set_id' }, function () {
|
||||
this.route('hosts');
|
||||
this.route('add-hosts');
|
||||
this.route('create-and-add-host');
|
||||
@@ -84,7 +84,7 @@ Router.map(function () {
|
||||
});
|
||||
});
|
||||
|
||||
this.route('account', function() {
|
||||
this.route('account', function () {
|
||||
this.route('change-password');
|
||||
});
|
||||
});
|
||||
@@ -2,7 +2,6 @@ import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class AccountRoute extends Route {
|
||||
|
||||
// =services
|
||||
|
||||
@service session;
|
||||
@@ -15,5 +14,4 @@ export default class AccountRoute extends Route {
|
||||
beforeModel() {
|
||||
if (!this.session.isAuthenticated) this.transitionTo('index');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import { notifySuccess, notifyError } from '../../decorators/notify';
|
||||
* The change password flow is associated only with password-type auth methods.
|
||||
*/
|
||||
export default class AccountChangePasswordRoute extends Route {
|
||||
|
||||
// =services
|
||||
|
||||
@service session;
|
||||
@@ -53,5 +52,4 @@ export default class AccountChangePasswordRoute extends Route {
|
||||
cancel() {
|
||||
this.replaceWith('index');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -127,7 +127,8 @@ export default class ApplicationRoute extends Route.extend(
|
||||
@action
|
||||
toggleTheme(theme) {
|
||||
const rootElementSelector = getOwner(this).rootElement;
|
||||
const rootEl = getOwner(this).lookup('service:-document')
|
||||
const rootEl = getOwner(this)
|
||||
.lookup('service:-document')
|
||||
.querySelector(rootElementSelector);
|
||||
this.session.set('data.theme', theme);
|
||||
switch (theme) {
|
||||
@@ -144,5 +145,4 @@ export default class ApplicationRoute extends Route.extend(
|
||||
rootEl.classList.remove('rose-theme-light');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -50,7 +50,8 @@ export default class ScopesScopeRoute extends Route {
|
||||
async afterModel(model) {
|
||||
// First, load orgs and, if necessary, projects
|
||||
let orgs, projects;
|
||||
orgs = await this.store.query('scope', { scope_id: 'global' })
|
||||
orgs = await this.store
|
||||
.query('scope', { scope_id: 'global' })
|
||||
.catch(() => A([]));
|
||||
if (model.isProject) {
|
||||
projects = await this.store.query('scope', { scope_id: model.scopeID });
|
||||
@@ -113,7 +114,9 @@ export default class ScopesScopeRoute extends Route {
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
@notifySuccess(({ isNew }) =>
|
||||
isNew ? 'notifications.create-success' : 'notifications.save-success'
|
||||
)
|
||||
async save(scope) {
|
||||
const { isNew } = scope;
|
||||
await scope.save();
|
||||
|
||||
@@ -49,7 +49,9 @@ export default class ScopesScopeAuthMethodsRoute extends Route {
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
@notifySuccess(({ isNew }) =>
|
||||
isNew ? 'notifications.create-success' : 'notifications.save-success'
|
||||
)
|
||||
async save(authMethod) {
|
||||
await authMethod.save();
|
||||
await this.transitionTo(
|
||||
|
||||
@@ -45,7 +45,9 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsRoute extends Route
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
@notifySuccess(({ isNew }) =>
|
||||
isNew ? 'notifications.create-success' : 'notifications.save-success'
|
||||
)
|
||||
async save(account, password) {
|
||||
const { isNew } = account;
|
||||
const adapterOptions = {};
|
||||
|
||||
+4
-1
@@ -2,7 +2,10 @@ import Route from '@ember/routing/route';
|
||||
import { action } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { notifySuccess, notifyError } from '../../../../../../../decorators/notify';
|
||||
import {
|
||||
notifySuccess,
|
||||
notifyError,
|
||||
} from '../../../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountSettingsRoute extends Route {
|
||||
// =services
|
||||
|
||||
@@ -22,7 +22,7 @@ export default class ScopesScopeAuthenticateRoute extends Route {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
return hash({
|
||||
scope: this.modelFor('scopes.scope'),
|
||||
scopes: this.modelFor('scopes').filter(scope => scope.isOrg),
|
||||
scopes: this.modelFor('scopes').filter((scope) => scope.isOrg),
|
||||
authMethods: this.store.query('auth-method', { scope_id }),
|
||||
|
||||
// for integration testing:
|
||||
|
||||
@@ -2,7 +2,6 @@ import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeEditRoute extends Route {
|
||||
|
||||
// =services
|
||||
|
||||
@service session;
|
||||
|
||||
@@ -49,7 +49,9 @@ export default class ScopesScopeGroupsRoute extends Route {
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
@notifySuccess(({ isNew }) =>
|
||||
isNew ? 'notifications.create-success' : 'notifications.save-success'
|
||||
)
|
||||
async save(group) {
|
||||
await group.save();
|
||||
await this.transitionTo('scopes.scope.groups.group', group);
|
||||
|
||||
@@ -51,7 +51,9 @@ export default class ScopesScopeHostCatalogsRoute extends Route {
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
@notifySuccess(({ isNew }) =>
|
||||
isNew ? 'notifications.create-success' : 'notifications.save-success'
|
||||
)
|
||||
async save(hostCatalog) {
|
||||
await hostCatalog.save();
|
||||
await this.transitionTo(
|
||||
|
||||
@@ -23,31 +23,22 @@ export default class ScopesScopeHostCatalogsHostCatalogRoute extends Route {
|
||||
renderTemplate(controller, model) {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/host-catalogs/host-catalog/-header',
|
||||
{
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
this.render('scopes/scope/host-catalogs/host-catalog/-header', {
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
model: model,
|
||||
});
|
||||
|
||||
this.render(
|
||||
'scopes/scope/host-catalogs/host-catalog/-navigation',
|
||||
{
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'navigation',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
this.render('scopes/scope/host-catalogs/host-catalog/-navigation', {
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'navigation',
|
||||
model: model,
|
||||
});
|
||||
|
||||
this.render(
|
||||
'scopes/scope/host-catalogs/host-catalog/-actions',
|
||||
{
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
this.render('scopes/scope/host-catalogs/host-catalog/-actions', {
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
model: model,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -35,9 +35,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsRoute extends Rou
|
||||
const { isNew } = hostSet;
|
||||
hostSet.rollbackAttributes();
|
||||
if (isNew)
|
||||
this.transitionTo(
|
||||
'scopes.scope.host-catalogs.host-catalog.host-sets'
|
||||
);
|
||||
this.transitionTo('scopes.scope.host-catalogs.host-catalog.host-sets');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +46,9 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsRoute extends Rou
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
@notifySuccess(({ isNew }) =>
|
||||
isNew ? 'notifications.create-success' : 'notifications.save-success'
|
||||
)
|
||||
async save(hostSet) {
|
||||
await hostSet.save();
|
||||
await this.transitionTo(
|
||||
@@ -69,8 +69,6 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsRoute extends Rou
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async deleteHostSet(hostSet) {
|
||||
await hostSet.destroyRecord();
|
||||
await this.replaceWith(
|
||||
'scopes.scope.host-catalogs.host-catalog.host-sets'
|
||||
);
|
||||
await this.replaceWith('scopes.scope.host-catalogs.host-catalog.host-sets');
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -3,7 +3,10 @@ import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import { hash } from 'rsvp';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { notifySuccess, notifyError } from '../../../../../../../decorators/notify';
|
||||
import {
|
||||
notifySuccess,
|
||||
notifyError,
|
||||
} from '../../../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetAddHostsRoute extends Route {
|
||||
// =services
|
||||
|
||||
+7
-2
@@ -2,7 +2,10 @@ import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { notifySuccess, notifyError } from '../../../../../../../decorators/notify';
|
||||
import {
|
||||
notifySuccess,
|
||||
notifyError,
|
||||
} from '../../../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetCreateAndAddHostRoute extends Route {
|
||||
// =services
|
||||
@@ -65,7 +68,9 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetCreateAndA
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.add-success')
|
||||
async save(host) {
|
||||
const hostSet = this.modelFor('scopes.scope.host-catalogs.host-catalog.host-sets.host-set');
|
||||
const hostSet = this.modelFor(
|
||||
'scopes.scope.host-catalogs.host-catalog.host-sets.host-set'
|
||||
);
|
||||
await host.save();
|
||||
await hostSet.addHost(host.id);
|
||||
await this.replaceWith(
|
||||
|
||||
+4
-1
@@ -4,7 +4,10 @@ import { action } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { confirm } from '../../../../../../../decorators/confirm';
|
||||
import { notifySuccess, notifyError } from '../../../../../../../decorators/notify';
|
||||
import {
|
||||
notifySuccess,
|
||||
notifyError,
|
||||
} from '../../../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetHostsRoute extends Route {
|
||||
// =services
|
||||
|
||||
+1
-2
@@ -1,4 +1,3 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetIndexRoute extends Route {
|
||||
}
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetIndexRoute extends Route {}
|
||||
@@ -1,4 +1,3 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostSetsIndexRoute extends Route {
|
||||
}
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostSetsIndexRoute extends Route {}
|
||||
@@ -35,9 +35,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsRoute extends Route
|
||||
const { isNew } = host;
|
||||
host.rollbackAttributes();
|
||||
if (isNew)
|
||||
this.transitionTo(
|
||||
'scopes.scope.host-catalogs.host-catalog.hosts'
|
||||
);
|
||||
this.transitionTo('scopes.scope.host-catalogs.host-catalog.hosts');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +46,9 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsRoute extends Route
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
@notifySuccess(({ isNew }) =>
|
||||
isNew ? 'notifications.create-success' : 'notifications.save-success'
|
||||
)
|
||||
async save(host) {
|
||||
await host.save();
|
||||
await this.transitionTo(
|
||||
@@ -69,9 +69,7 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsRoute extends Route
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async deleteHost(host) {
|
||||
await host.destroyRecord();
|
||||
await this.replaceWith(
|
||||
'scopes.scope.host-catalogs.host-catalog.hosts'
|
||||
);
|
||||
await this.replaceWith('scopes.scope.host-catalogs.host-catalog.hosts');
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -22,14 +22,11 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsHostRoute extends Ro
|
||||
renderTemplate(controller, model) {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/host-catalogs/host-catalog/hosts/host/-header',
|
||||
{
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
this.render('scopes/scope/host-catalogs/host-catalog/hosts/host/-header', {
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
model: model,
|
||||
});
|
||||
|
||||
this.render(
|
||||
'scopes/scope/host-catalogs/host-catalog/hosts/host/-navigation',
|
||||
@@ -40,13 +37,10 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsHostRoute extends Ro
|
||||
}
|
||||
);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/host-catalogs/host-catalog/hosts/host/-actions',
|
||||
{
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
this.render('scopes/scope/host-catalogs/host-catalog/hosts/host/-actions', {
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
model: model,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostsHostIndexRoute extends Route {
|
||||
}
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostsHostIndexRoute extends Route {}
|
||||
@@ -1,4 +1,3 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostsIndexRoute extends Route {
|
||||
}
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostsIndexRoute extends Route {}
|
||||
@@ -27,14 +27,11 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsNewRoute extends Rou
|
||||
renderTemplate(controller, model) {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/host-catalogs/host-catalog/hosts/new/-header',
|
||||
{
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
this.render('scopes/scope/host-catalogs/host-catalog/hosts/new/-header', {
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
model: model,
|
||||
});
|
||||
|
||||
this.render('_empty', {
|
||||
into: 'scopes/scope/host-catalogs/host-catalog',
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeHostCatalogsIndexRoute extends Route {
|
||||
}
|
||||
export default class ScopesScopeHostCatalogsIndexRoute extends Route {}
|
||||
@@ -2,7 +2,6 @@ import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeNewRoute extends Route {
|
||||
|
||||
// =services
|
||||
|
||||
@service session;
|
||||
|
||||
@@ -49,7 +49,9 @@ export default class ScopesScopeRolesRoute extends Route {
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
@notifySuccess(({ isNew }) =>
|
||||
isNew ? 'notifications.create-success' : 'notifications.save-success'
|
||||
)
|
||||
async save(role) {
|
||||
await role.save();
|
||||
await this.transitionTo('scopes.scope.roles.role', role);
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeRolesRoleIndexRoute extends Route {
|
||||
|
||||
/**
|
||||
* Load the role's scope and sub scopes into a hierarchical data structure.
|
||||
* @param {Model} model
|
||||
*/
|
||||
async afterModel(model) {
|
||||
const defaultScope = await this.store.findRecord('scope', model.scopeID);
|
||||
const subScopes = (await this.store.query('scope', { scope_id: defaultScope.id }))
|
||||
.map(scope => ({
|
||||
model: scope,
|
||||
subScopes: this.store.query('scope', { scope_id: scope.id })
|
||||
}));
|
||||
const grantScopes = [{
|
||||
model: defaultScope,
|
||||
subScopes
|
||||
}];
|
||||
const subScopes = (
|
||||
await this.store.query('scope', { scope_id: defaultScope.id })
|
||||
).map((scope) => ({
|
||||
model: scope,
|
||||
subScopes: this.store.query('scope', { scope_id: scope.id }),
|
||||
}));
|
||||
const grantScopes = [
|
||||
{
|
||||
model: defaultScope,
|
||||
subScopes,
|
||||
},
|
||||
];
|
||||
this.set('grantScopes', grantScopes);
|
||||
}
|
||||
|
||||
@@ -28,5 +30,4 @@ export default class ScopesScopeRolesRoleIndexRoute extends Route {
|
||||
super.setupController(...arguments);
|
||||
controller.set('grantScopes', this.grantScopes);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -75,5 +75,4 @@ export default class ScopesScopeRolesRolePrincipalsRoute extends Route {
|
||||
await role.removePrincipal(principal.id);
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,12 +29,13 @@ export default class ScopesScopeScopesRoute extends Route {
|
||||
const parentScope = !currentScope.isGlobal
|
||||
? await this.store.findRecord('scope', currentScope.scopeID)
|
||||
: null;
|
||||
const subScopes =
|
||||
await this.store.query('scope', { scope_id: currentScope.id });
|
||||
const subScopes = await this.store.query('scope', {
|
||||
scope_id: currentScope.id,
|
||||
});
|
||||
return {
|
||||
currentScope,
|
||||
parentScope,
|
||||
subScopes
|
||||
subScopes,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeScopesIndexRoute extends Route {
|
||||
}
|
||||
export default class ScopesScopeScopesIndexRoute extends Route {}
|
||||
@@ -1,4 +1,3 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeSessionsIndexRoute extends Route {
|
||||
}
|
||||
export default class ScopesScopeSessionsIndexRoute extends Route {}
|
||||
@@ -51,7 +51,9 @@ export default class ScopesScopeTargetsRoute extends Route {
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
@notifySuccess(({ isNew }) =>
|
||||
isNew ? 'notifications.create-success' : 'notifications.save-success'
|
||||
)
|
||||
async save(target) {
|
||||
await target.save();
|
||||
await this.transitionTo('scopes.scope.targets.target', target);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeTargetsIndexRoute extends Route {
|
||||
}
|
||||
export default class ScopesScopeTargetsIndexRoute extends Route {}
|
||||
@@ -25,9 +25,7 @@ export default class ScopesScopeTargetsTargetAddHostSetsRoute extends Route {
|
||||
* @return {{target: TargetModel, hostCatalogs: [HostCatalogModel], hostSets: [HostSetModel]}}
|
||||
*/
|
||||
async model() {
|
||||
const target = this.modelFor(
|
||||
'scopes.scope.targets.target'
|
||||
);
|
||||
const target = this.modelFor('scopes.scope.targets.target');
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
const hostCatalogs = await this.store.query('host-catalog', { scope_id });
|
||||
await all(
|
||||
@@ -50,13 +48,10 @@ export default class ScopesScopeTargetsTargetAddHostSetsRoute extends Route {
|
||||
renderTemplate() {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/targets/target/add-host-sets/-header',
|
||||
{
|
||||
into: 'scopes/scope/targets/target',
|
||||
outlet: 'header',
|
||||
}
|
||||
);
|
||||
this.render('scopes/scope/targets/target/add-host-sets/-header', {
|
||||
into: 'scopes/scope/targets/target',
|
||||
outlet: 'header',
|
||||
});
|
||||
|
||||
this.render('-empty', {
|
||||
into: 'scopes/scope/targets/target',
|
||||
@@ -77,9 +72,7 @@ export default class ScopesScopeTargetsTargetAddHostSetsRoute extends Route {
|
||||
@notifySuccess('notifications.add-success')
|
||||
async save(target, hostSetIDs) {
|
||||
await target.addHostSets(hostSetIDs);
|
||||
this.replaceWith(
|
||||
'scopes.scope.targets.target.host-sets'
|
||||
);
|
||||
this.replaceWith('scopes.scope.targets.target.host-sets');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,9 +20,7 @@ export default class ScopesScopeTargetsTargetHostSetsRoute extends Route {
|
||||
* @return {Promise{[HostSetModel, HostCatalogModel]}}
|
||||
*/
|
||||
beforeModel() {
|
||||
const { scopeID, host_sets } = this.modelFor(
|
||||
'scopes.scope.targets.target'
|
||||
);
|
||||
const { scopeID, host_sets } = this.modelFor('scopes.scope.targets.target');
|
||||
const promises = host_sets.map(
|
||||
({ host_set_id, host_catalog_id: hostCatalogID }) =>
|
||||
hash({
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeTargetsTargetIndexRoute extends Route {
|
||||
}
|
||||
export default class ScopesScopeTargetsTargetIndexRoute extends Route {}
|
||||
@@ -50,7 +50,9 @@ export default class ScopesScopeUsersRoute extends Route {
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
@notifySuccess(({ isNew }) =>
|
||||
isNew ? 'notifications.create-success' : 'notifications.save-success'
|
||||
)
|
||||
async save(user) {
|
||||
await user.save();
|
||||
await this.transitionTo('scopes.scope.users.user', user);
|
||||
|
||||
@@ -15,7 +15,6 @@ import config from '../config/environment';
|
||||
* const confirmation = confirmationService.confirm('Text', { type: 'discard' });
|
||||
*/
|
||||
export default class ConfirmationsService extends Service {
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
@@ -54,7 +53,6 @@ export default class ConfirmationsService extends Service {
|
||||
return resolve();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +82,6 @@ export default class ConfirmationsService extends Service {
|
||||
* .finally(() => { }); // do something
|
||||
*/
|
||||
class Confirmation {
|
||||
|
||||
// =properties
|
||||
|
||||
/**
|
||||
@@ -101,7 +98,7 @@ class Confirmation {
|
||||
* @param {String} type An optional type annotation for convenience.
|
||||
* Has no effect on confirmation.
|
||||
*/
|
||||
constructor(text, options={}) {
|
||||
constructor(text, options = {}) {
|
||||
this.text = text;
|
||||
this.options = options;
|
||||
this.#deferred = defer();
|
||||
@@ -146,5 +143,4 @@ class Confirmation {
|
||||
finally() {
|
||||
return this.#deferred.promise.finally(...arguments);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import { tracked } from '@glimmer/tracking';
|
||||
* the currently active scope or scopes.
|
||||
*/
|
||||
export default class ScopeService extends Service {
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
@@ -18,5 +17,4 @@ export default class ScopeService extends Service {
|
||||
* @type {ScopeModel}
|
||||
*/
|
||||
@tracked project;
|
||||
|
||||
}
|
||||
@@ -63,8 +63,8 @@ module.exports = function (environment) {
|
||||
target: '/targets',
|
||||
'target.new': '/targets/new',
|
||||
'target.add-host-sets': '/targets/add-host-sets',
|
||||
user: '/users'
|
||||
}
|
||||
user: '/users',
|
||||
},
|
||||
},
|
||||
|
||||
contentSecurityPolicyHeader: 'Content-Security-Policy',
|
||||
|
||||
@@ -23,8 +23,7 @@ module.exports = function (defaults) {
|
||||
// Only import when in development or test mode
|
||||
if (app.env.match(/(development)|(test)/i)) {
|
||||
app.import('node_modules/clipboard/dist/clipboard.js');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
app.import('node_modules/clipboard/dist/clipboard.min.js');
|
||||
}
|
||||
|
||||
|
||||
@@ -54,9 +54,9 @@ module('Acceptance | accounts', function (hooks) {
|
||||
urls.account = `${urls.accounts}/${instances.account.id}`;
|
||||
});
|
||||
|
||||
hooks.afterEach(async function() {
|
||||
hooks.afterEach(async function () {
|
||||
const notification = find('.rose-notification');
|
||||
if(notification) {
|
||||
if (notification) {
|
||||
await click('.rose-notification-dismiss');
|
||||
}
|
||||
});
|
||||
@@ -87,7 +87,7 @@ module('Acceptance | accounts', function (hooks) {
|
||||
|
||||
test('can update an account and cancel changes', async function (assert) {
|
||||
assert.expect(1);
|
||||
await visit(urls.account)
|
||||
await visit(urls.account);
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'update name');
|
||||
await click('form button:not([type="submit"])');
|
||||
|
||||
@@ -37,10 +37,10 @@ module('Acceptance | accounts | change password', function (hooks) {
|
||||
scope: instances.scopes.org,
|
||||
});
|
||||
instances.account = this.server.create('account', {
|
||||
scope: instances.scopes.org
|
||||
scope: instances.scopes.org,
|
||||
});
|
||||
authenticateSession({
|
||||
account_id: instances.account.id
|
||||
account_id: instances.account.id,
|
||||
});
|
||||
// Generate route URLs for resources
|
||||
urls.orgScope = `/scopes/${instances.scopes.org.id}`;
|
||||
@@ -60,19 +60,32 @@ module('Acceptance | accounts | change password', function (hooks) {
|
||||
// Open header utilities dropdown
|
||||
await click('.rose-header-utilities .rose-dropdown summary');
|
||||
// Find first element in dropdown - should be change password link
|
||||
await click('.rose-header-utilities .rose-dropdown .rose-dropdown-content a');
|
||||
await click(
|
||||
'.rose-header-utilities .rose-dropdown .rose-dropdown-content a'
|
||||
);
|
||||
assert.equal(currentURL(), urls.changePassword);
|
||||
});
|
||||
|
||||
test('can change password for account', async function (assert) {
|
||||
assert.expect(2);
|
||||
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 };
|
||||
});
|
||||
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');
|
||||
await fillIn('[name="newPassword"]', 'new password');
|
||||
@@ -89,7 +102,7 @@ module('Acceptance | accounts | change password', function (hooks) {
|
||||
assert.notEqual(currentURL(), urls.changePassword);
|
||||
});
|
||||
|
||||
test('errors are displayed when changing password fails', async function (assert) {
|
||||
test('errors are displayed when changing password fails', async function (assert) {
|
||||
assert.expect(1);
|
||||
this.server.post('/accounts/:id', () => {
|
||||
return new Response(
|
||||
@@ -110,7 +123,7 @@ module('Acceptance | accounts | change password', function (hooks) {
|
||||
assert.ok(find('[role="alert"]'));
|
||||
});
|
||||
|
||||
test('cannot change password when not authenticated', async function(assert) {
|
||||
test('cannot change password when not authenticated', async function (assert) {
|
||||
assert.expect(1);
|
||||
invalidateSession();
|
||||
await visit(urls.changePassword);
|
||||
|
||||
@@ -61,12 +61,15 @@ 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/: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 };
|
||||
});
|
||||
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');
|
||||
await click('form [type="submit"]:not(:disabled)');
|
||||
@@ -84,7 +87,7 @@ module('Acceptance | accounts | set password', function (hooks) {
|
||||
// assert.notOk(find('[name="password"]').textContent.trim());
|
||||
// });
|
||||
|
||||
test('errors are displayed when setting password fails', async function (assert) {
|
||||
test('errors are displayed when setting password fails', async function (assert) {
|
||||
assert.expect(1);
|
||||
this.server.post('/accounts/:id', () => {
|
||||
return new Response(
|
||||
|
||||
@@ -6,9 +6,9 @@ import a11yAudit from 'ember-a11y-testing/test-support/audit';
|
||||
import { Response } from 'miragejs';
|
||||
import {
|
||||
authenticateSession,
|
||||
// // These are left here intentionally for future reference.
|
||||
// //currentSession,
|
||||
// //invalidateSession,
|
||||
// // These are left here intentionally for future reference.
|
||||
// //currentSession,
|
||||
// //invalidateSession,
|
||||
} from 'ember-simple-auth/test-support';
|
||||
|
||||
module('Acceptance | auth methods', function (hooks) {
|
||||
@@ -74,7 +74,7 @@ module('Acceptance | auth methods', function (hooks) {
|
||||
|
||||
test('can update an auth method and cancel changes', async function (assert) {
|
||||
assert.expect(1);
|
||||
await visit(urls.authMethod)
|
||||
await visit(urls.authMethod);
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'update name');
|
||||
await click('form button:not([type="submit"])');
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
click,
|
||||
find,
|
||||
findAll,
|
||||
getRootElement
|
||||
getRootElement,
|
||||
//setupOnerror,
|
||||
} from '@ember/test-helpers';
|
||||
import { setupApplicationTest } from 'ember-qunit';
|
||||
@@ -319,7 +319,9 @@ module('Acceptance | authentication', function (hooks) {
|
||||
|
||||
test('color theme is applied from session data', async function (assert) {
|
||||
assert.expect(12);
|
||||
authenticateSession({ scope: { id: globalScope.id, type: globalScope.type } });
|
||||
authenticateSession({
|
||||
scope: { id: globalScope.id, type: globalScope.type },
|
||||
});
|
||||
// system default
|
||||
await visit(orgsURL);
|
||||
assert.notOk(currentSession().get('data.theme'));
|
||||
|
||||
@@ -38,9 +38,13 @@ module('Acceptance | groups | members', function (hooks) {
|
||||
type: 'org',
|
||||
scope: { id: 'global', type: 'global' },
|
||||
});
|
||||
instances.group = this.server.create('group', {
|
||||
scope: instances.scopes.org,
|
||||
}, 'withMembers');
|
||||
instances.group = this.server.create(
|
||||
'group',
|
||||
{
|
||||
scope: instances.scopes.org,
|
||||
},
|
||||
'withMembers'
|
||||
);
|
||||
membersCount = instances.group.memberIds.length;
|
||||
urls.groups = `/scopes/${instances.scopes.org.id}/groups`;
|
||||
urls.group = `${urls.groups}/${instances.group.id}`;
|
||||
@@ -84,7 +88,7 @@ module('Acceptance | groups | members', function (hooks) {
|
||||
assert.ok(find('[role="alert"]'));
|
||||
});
|
||||
|
||||
test('visiting member selection', async function(assert) {
|
||||
test('visiting member selection', async function (assert) {
|
||||
assert.expect(1);
|
||||
await visit(urls.addMembers);
|
||||
await a11yAudit();
|
||||
@@ -96,7 +100,7 @@ module('Acceptance | groups | members', function (hooks) {
|
||||
instances.group.update({ memberIds: [] });
|
||||
await visit(urls.members);
|
||||
assert.equal(findAll('tbody tr').length, 0);
|
||||
await click('.rose-layout-page-actions a')
|
||||
await click('.rose-layout-page-actions a');
|
||||
assert.equal(currentURL(), urls.addMembers);
|
||||
// Click three times to select, unselect, then reselect (for coverage)
|
||||
await click('tbody label');
|
||||
@@ -113,7 +117,7 @@ module('Acceptance | groups | members', function (hooks) {
|
||||
assert.equal(findAll('tbody tr').length, membersCount);
|
||||
await click('tbody tr .rose-dropdown-button-danger');
|
||||
assert.equal(findAll('tbody tr').length, membersCount - 1);
|
||||
await click('.rose-layout-page-actions a')
|
||||
await click('.rose-layout-page-actions a');
|
||||
assert.equal(currentURL(), urls.addMembers);
|
||||
await click('tbody label');
|
||||
await click('form [type="button"]');
|
||||
|
||||
@@ -24,7 +24,7 @@ module('Acceptance | host-catalogs', function (hooks) {
|
||||
global: null,
|
||||
org: null,
|
||||
project: null,
|
||||
}
|
||||
},
|
||||
};
|
||||
const urls = {
|
||||
globalScope: null,
|
||||
@@ -58,7 +58,8 @@ module('Acceptance | host-catalogs', function (hooks) {
|
||||
urls.unknownHostCatalog = `${urls.hostCatalogs}/foo`;
|
||||
urls.newHostCatalog = `${urls.hostCatalogs}/new`;
|
||||
// Generate resource couner
|
||||
gethostCatalogCount = () => this.server.schema.hostCatalogs.all().models.length;
|
||||
gethostCatalogCount = () =>
|
||||
this.server.schema.hostCatalogs.all().models.length;
|
||||
authenticateSession({});
|
||||
});
|
||||
|
||||
@@ -121,7 +122,10 @@ module('Acceptance | host-catalogs', function (hooks) {
|
||||
});
|
||||
await visit(urls.newHostCatalog);
|
||||
await click('[type="submit"]');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'The request was invalid.');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.'
|
||||
@@ -136,7 +140,10 @@ module('Acceptance | host-catalogs', function (hooks) {
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('.rose-form-actions [type="submit"]');
|
||||
assert.equal(currentURL(), urls.hostCatalog);
|
||||
assert.equal(this.server.schema.hostCatalogs.all().models[0].name, 'random string');
|
||||
assert.equal(
|
||||
this.server.schema.hostCatalogs.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
});
|
||||
|
||||
test('can cancel changes to existing host catalog', async function (assert) {
|
||||
@@ -174,7 +181,10 @@ module('Acceptance | host-catalogs', function (hooks) {
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'The request was invalid.');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.'
|
||||
@@ -196,7 +206,10 @@ module('Acceptance | host-catalogs', function (hooks) {
|
||||
assert.ok(find('.rose-dialog'));
|
||||
await click('.rose-dialog-footer button:first-child');
|
||||
assert.equal(currentURL(), urls.hostCatalogs);
|
||||
assert.notEqual(this.server.schema.hostCatalogs.all().models[0].name, 'random string');
|
||||
assert.notEqual(
|
||||
this.server.schema.hostCatalogs.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -215,7 +228,10 @@ module('Acceptance | host-catalogs', function (hooks) {
|
||||
assert.ok(find('.rose-dialog'));
|
||||
await click('.rose-dialog-footer button:last-child');
|
||||
assert.equal(currentURL(), urls.hostCatalog);
|
||||
assert.notEqual(this.server.schema.hostCatalogs.all().models[0].name, 'random string');
|
||||
assert.notEqual(
|
||||
this.server.schema.hostCatalogs.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -268,5 +284,4 @@ module('Acceptance | host-catalogs', function (hooks) {
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'Oops.');
|
||||
});
|
||||
|
||||
});
|
||||
@@ -25,8 +25,8 @@ module('Acceptance | host-catalogs | host sets', function (hooks) {
|
||||
org: null,
|
||||
project: null,
|
||||
hostCatalog: null,
|
||||
host: null
|
||||
}
|
||||
host: null,
|
||||
},
|
||||
};
|
||||
const urls = {
|
||||
globalScope: null,
|
||||
@@ -56,7 +56,7 @@ module('Acceptance | host-catalogs | host sets', function (hooks) {
|
||||
});
|
||||
instances.hostSet = this.server.create('host-set', {
|
||||
scope: instances.scopes.project,
|
||||
hostCatalog: instances.hostCatalog
|
||||
hostCatalog: instances.hostCatalog,
|
||||
});
|
||||
// Generate route URLs for resources
|
||||
urls.globalScope = `/scopes/global/scopes`;
|
||||
@@ -132,7 +132,10 @@ module('Acceptance | host-catalogs | host sets', function (hooks) {
|
||||
});
|
||||
await visit(urls.newHostSet);
|
||||
await click('[type="submit"]');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'The request was invalid.');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.'
|
||||
@@ -147,7 +150,10 @@ module('Acceptance | host-catalogs | host sets', function (hooks) {
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('.rose-form-actions [type="submit"]');
|
||||
assert.equal(currentURL(), urls.hostSet);
|
||||
assert.equal(this.server.schema.hostSets.all().models[0].name, 'random string');
|
||||
assert.equal(
|
||||
this.server.schema.hostSets.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
});
|
||||
|
||||
test('can cancel changes to existing host', async function (assert) {
|
||||
@@ -185,7 +191,10 @@ module('Acceptance | host-catalogs | host sets', function (hooks) {
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'The request was invalid.');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.'
|
||||
@@ -207,7 +216,10 @@ module('Acceptance | host-catalogs | host sets', function (hooks) {
|
||||
assert.ok(find('.rose-dialog'));
|
||||
await click('.rose-dialog-footer button:first-child');
|
||||
assert.equal(currentURL(), urls.hostSets);
|
||||
assert.notEqual(this.server.schema.hostSets.all().models[0].name, 'random string');
|
||||
assert.notEqual(
|
||||
this.server.schema.hostSets.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -226,7 +238,10 @@ module('Acceptance | host-catalogs | host sets', function (hooks) {
|
||||
assert.ok(find('.rose-dialog'));
|
||||
await click('.rose-dialog-footer button:last-child');
|
||||
assert.equal(currentURL(), urls.hostSet);
|
||||
assert.notEqual(this.server.schema.hostSets.all().models[0].name, 'random string');
|
||||
assert.notEqual(
|
||||
this.server.schema.hostSets.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -279,5 +294,4 @@ module('Acceptance | host-catalogs | host sets', function (hooks) {
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'Oops.');
|
||||
});
|
||||
|
||||
});
|
||||
@@ -1,5 +1,12 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { visit, currentURL, click, find, findAll, fillIn } from '@ember/test-helpers';
|
||||
import {
|
||||
visit,
|
||||
currentURL,
|
||||
click,
|
||||
find,
|
||||
findAll,
|
||||
fillIn,
|
||||
} from '@ember/test-helpers';
|
||||
import { setupApplicationTest } from 'ember-qunit';
|
||||
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
|
||||
import a11yAudit from 'ember-a11y-testing/test-support/audit';
|
||||
@@ -23,8 +30,8 @@ module('Acceptance | host-catalogs | host-sets | hosts', function (hooks) {
|
||||
org: null,
|
||||
project: null,
|
||||
hostCatalog: null,
|
||||
host: null
|
||||
}
|
||||
host: null,
|
||||
},
|
||||
};
|
||||
const urls = {
|
||||
globalScope: null,
|
||||
@@ -50,9 +57,13 @@ module('Acceptance | host-catalogs | host-sets | hosts', function (hooks) {
|
||||
type: 'project',
|
||||
scope: { id: instances.scopes.org.id, type: 'org' },
|
||||
});
|
||||
instances.hostCatalog = this.server.create('host-catalog', {
|
||||
scope: instances.scopes.project,
|
||||
}, 'withChildren');
|
||||
instances.hostCatalog = this.server.create(
|
||||
'host-catalog',
|
||||
{
|
||||
scope: instances.scopes.project,
|
||||
},
|
||||
'withChildren'
|
||||
);
|
||||
instances.hostSet = this.server.schema.hostSets.all().models[0];
|
||||
// Generate route URLs for resources
|
||||
urls.globalScope = `/scopes/global/scopes`;
|
||||
@@ -108,7 +119,7 @@ module('Acceptance | host-catalogs | host-sets | hosts', function (hooks) {
|
||||
assert.ok(find('[role="alert"]'));
|
||||
});
|
||||
|
||||
test('visiting add hosts', async function(assert) {
|
||||
test('visiting add hosts', async function (assert) {
|
||||
assert.expect(1);
|
||||
await visit(urls.addHosts);
|
||||
await a11yAudit();
|
||||
@@ -120,7 +131,7 @@ module('Acceptance | host-catalogs | host-sets | hosts', function (hooks) {
|
||||
instances.hostSet.update({ hostIds: [] });
|
||||
await visit(urls.hostSetHosts);
|
||||
assert.equal(findAll('tbody tr').length, 0);
|
||||
await click('.rose-layout-page-actions a:nth-child(2)')
|
||||
await click('.rose-layout-page-actions a:nth-child(2)');
|
||||
assert.equal(currentURL(), urls.addHosts);
|
||||
// Click three times to select, unselect, then reselect (for coverage)
|
||||
await click('tbody label');
|
||||
@@ -138,7 +149,7 @@ module('Acceptance | host-catalogs | host-sets | hosts', function (hooks) {
|
||||
assert.equal(findAll('tbody tr').length, count);
|
||||
await click('tbody tr .rose-dropdown-button-danger');
|
||||
assert.equal(findAll('tbody tr').length, count - 1);
|
||||
await click('.rose-layout-page-actions a:nth-child(2)')
|
||||
await click('.rose-layout-page-actions a:nth-child(2)');
|
||||
assert.equal(currentURL(), urls.addHosts);
|
||||
await click('tbody label');
|
||||
await click('form [type="button"]');
|
||||
@@ -179,7 +190,7 @@ module('Acceptance | host-catalogs | host-sets | hosts', function (hooks) {
|
||||
instances.hostSet.update({ hostIds: [] });
|
||||
await visit(urls.hostSet);
|
||||
assert.equal(findAll('tbody tr').length, 0);
|
||||
await click('.rose-layout-page-actions a:nth-child(1)')
|
||||
await click('.rose-layout-page-actions a:nth-child(1)');
|
||||
assert.equal(currentURL(), urls.createAndAddHost);
|
||||
await fillIn('[name="name"]', 'Test Name');
|
||||
await fillIn('[name="description"]', 'description');
|
||||
@@ -236,5 +247,4 @@ module('Acceptance | host-catalogs | host-sets | hosts', function (hooks) {
|
||||
await click('form [type="submit"]');
|
||||
assert.ok(find('[role="alert"]'));
|
||||
});
|
||||
|
||||
});
|
||||
@@ -25,8 +25,8 @@ module('Acceptance | host-catalogs | hosts', function (hooks) {
|
||||
org: null,
|
||||
project: null,
|
||||
hostCatalog: null,
|
||||
host: null
|
||||
}
|
||||
host: null,
|
||||
},
|
||||
};
|
||||
const urls = {
|
||||
globalScope: null,
|
||||
@@ -56,7 +56,7 @@ module('Acceptance | host-catalogs | hosts', function (hooks) {
|
||||
});
|
||||
instances.host = this.server.create('host', {
|
||||
scope: instances.scopes.project,
|
||||
hostCatalog: instances.hostCatalog
|
||||
hostCatalog: instances.hostCatalog,
|
||||
});
|
||||
// Generate route URLs for resources
|
||||
urls.globalScope = `/scopes/global/scopes`;
|
||||
@@ -132,7 +132,10 @@ module('Acceptance | host-catalogs | hosts', function (hooks) {
|
||||
});
|
||||
await visit(urls.newHost);
|
||||
await click('[type="submit"]');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'The request was invalid.');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.'
|
||||
@@ -147,7 +150,10 @@ module('Acceptance | host-catalogs | hosts', function (hooks) {
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('.rose-form-actions [type="submit"]');
|
||||
assert.equal(currentURL(), urls.host);
|
||||
assert.equal(this.server.schema.hosts.all().models[0].name, 'random string');
|
||||
assert.equal(
|
||||
this.server.schema.hosts.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
});
|
||||
|
||||
test('can cancel changes to existing host', async function (assert) {
|
||||
@@ -185,7 +191,10 @@ module('Acceptance | host-catalogs | hosts', function (hooks) {
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'The request was invalid.');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.'
|
||||
@@ -207,7 +216,10 @@ module('Acceptance | host-catalogs | hosts', function (hooks) {
|
||||
assert.ok(find('.rose-dialog'));
|
||||
await click('.rose-dialog-footer button:first-child');
|
||||
assert.equal(currentURL(), urls.hosts);
|
||||
assert.notEqual(this.server.schema.hosts.all().models[0].name, 'random string');
|
||||
assert.notEqual(
|
||||
this.server.schema.hosts.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -226,7 +238,10 @@ module('Acceptance | host-catalogs | hosts', function (hooks) {
|
||||
assert.ok(find('.rose-dialog'));
|
||||
await click('.rose-dialog-footer button:last-child');
|
||||
assert.equal(currentURL(), urls.host);
|
||||
assert.notEqual(this.server.schema.hosts.all().models[0].name, 'random string');
|
||||
assert.notEqual(
|
||||
this.server.schema.hosts.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -279,5 +294,4 @@ module('Acceptance | host-catalogs | hosts', function (hooks) {
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'Oops.');
|
||||
});
|
||||
|
||||
});
|
||||
@@ -44,9 +44,13 @@ module('Acceptance | roles', function (hooks) {
|
||||
type: 'project',
|
||||
scope: { id: instances.scopes.org.id, type: instances.scopes.org.type },
|
||||
});
|
||||
instances.role = this.server.create('role', {
|
||||
scope: instances.scopes.org,
|
||||
}, 'withPrincipals');
|
||||
instances.role = this.server.create(
|
||||
'role',
|
||||
{
|
||||
scope: instances.scopes.org,
|
||||
},
|
||||
'withPrincipals'
|
||||
);
|
||||
urls.roles = `/scopes/${instances.scopes.org.id}/roles`;
|
||||
urls.role = `${urls.roles}/${instances.role.id}`;
|
||||
urls.newRole = `${urls.roles}/new`;
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { visit, currentURL, click, fillIn, find, findAll } from '@ember/test-helpers';
|
||||
import {
|
||||
visit,
|
||||
currentURL,
|
||||
click,
|
||||
fillIn,
|
||||
find,
|
||||
findAll,
|
||||
} from '@ember/test-helpers';
|
||||
import { setupApplicationTest } from 'ember-qunit';
|
||||
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
|
||||
import a11yAudit from 'ember-a11y-testing/test-support/audit';
|
||||
@@ -56,25 +63,35 @@ module('Acceptance | roles | grants', function (hooks) {
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length, grantsCount);
|
||||
});
|
||||
|
||||
test('update a grant', async function(assert) {
|
||||
test('update a grant', async function (assert) {
|
||||
assert.expect(1);
|
||||
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 };
|
||||
});
|
||||
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');
|
||||
await click('.rose-form-actions [type="submit"]:not(:disabled)');
|
||||
});
|
||||
|
||||
test('cancel a grant update', async function(assert) {
|
||||
test('cancel a grant update', async function (assert) {
|
||||
assert.expect(1);
|
||||
await visit(urls.grants);
|
||||
await fillIn(`${grantsForm} [name="grant"]`, 'id=123,action=delete');
|
||||
await click('.rose-form-actions button:not([type="submit"])');
|
||||
assert.notEqual(find(`${grantsForm} [name="grant"]`).value, 'id=123,action=delete');
|
||||
assert.notEqual(
|
||||
find(`${grantsForm} [name="grant"]`).value,
|
||||
'id=123,action=delete'
|
||||
);
|
||||
});
|
||||
|
||||
test('shows error message on grant update', async function (assert) {
|
||||
@@ -92,28 +109,34 @@ module('Acceptance | roles | grants', function (hooks) {
|
||||
);
|
||||
});
|
||||
await visit(urls.grants);
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length,
|
||||
grantsCount);
|
||||
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)');
|
||||
assert.ok(find('[role="alert"]'));
|
||||
});
|
||||
|
||||
test('create a grant', async function(assert) {
|
||||
test('create a grant', async function (assert) {
|
||||
assert.expect(1);
|
||||
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 };
|
||||
});
|
||||
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');
|
||||
await click(`${newGrantForm} [type="submit"]:not(:disabled)`);
|
||||
await click('.rose-form-actions [type="submit"]:not(:disabled)');
|
||||
});
|
||||
|
||||
test('cancel a grant creation', async function(assert) {
|
||||
test('cancel a grant creation', async function (assert) {
|
||||
assert.expect(1);
|
||||
await visit(urls.grants);
|
||||
await fillIn(`${newGrantForm} [name="grant"]`, 'id=123,action=delete');
|
||||
@@ -137,24 +160,25 @@ module('Acceptance | roles | grants', function (hooks) {
|
||||
);
|
||||
});
|
||||
await visit(urls.grants);
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length,
|
||||
grantsCount);
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length, grantsCount);
|
||||
await fillIn(`${newGrantForm} [name="grant"]`, 'id=123,action=delete');
|
||||
await click(`${newGrantForm} [type="submit"]:not(:disabled)`);
|
||||
await click('.rose-form-actions [type="submit"]:not(:disabled)');
|
||||
assert.ok(find('[role="alert"]'));
|
||||
});
|
||||
|
||||
test('delete a grant', async function(assert) {
|
||||
test('delete a grant', async function (assert) {
|
||||
assert.expect(1);
|
||||
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,
|
||||
grantsCount - 1);
|
||||
assert.equal(
|
||||
findAll(`${grantsForm} [name="grant"]`).length,
|
||||
grantsCount - 1
|
||||
);
|
||||
});
|
||||
|
||||
test('cancel a grant remove', async function(assert) {
|
||||
test('cancel a grant remove', async function (assert) {
|
||||
assert.expect(1);
|
||||
await visit(urls.grants);
|
||||
await click(`${grantsForm} button`);
|
||||
@@ -177,8 +201,7 @@ module('Acceptance | roles | grants', function (hooks) {
|
||||
);
|
||||
});
|
||||
await visit(urls.grants);
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length,
|
||||
grantsCount);
|
||||
assert.equal(findAll(`${grantsForm} [name="grant"]`).length, grantsCount);
|
||||
await click(`${grantsForm} button:not([type="submit"])`);
|
||||
await click('.rose-form-actions [type="submit"]:not(:disabled)');
|
||||
assert.ok(find('[role="alert"]'));
|
||||
|
||||
@@ -37,10 +37,16 @@ module('Acceptance | roles | principals', function (hooks) {
|
||||
type: 'org',
|
||||
scope: { id: 'global', type: 'global' },
|
||||
});
|
||||
instances.role = this.server.create('role', {
|
||||
scope: instances.scopes.org,
|
||||
}, 'withPrincipals');
|
||||
principalsCount = this.server.db.roles[0].userIds.length + this.server.db.roles[0].groupIds.length;
|
||||
instances.role = this.server.create(
|
||||
'role',
|
||||
{
|
||||
scope: instances.scopes.org,
|
||||
},
|
||||
'withPrincipals'
|
||||
);
|
||||
principalsCount =
|
||||
this.server.db.roles[0].userIds.length +
|
||||
this.server.db.roles[0].groupIds.length;
|
||||
urls.roles = `/scopes/${instances.scopes.org.id}/roles`;
|
||||
urls.role = `${urls.roles}/${instances.role.id}`;
|
||||
urls.rolePrincipals = `${urls.role}/principals`;
|
||||
@@ -88,7 +94,7 @@ module('Acceptance | roles | principals', function (hooks) {
|
||||
instances.role.update({ userIds: [], groupIds: [] });
|
||||
await visit(urls.rolePrincipals);
|
||||
assert.equal(findAll('tbody tr').length, 0);
|
||||
await click('.rose-layout-page-actions a')
|
||||
await click('.rose-layout-page-actions a');
|
||||
assert.equal(currentURL(), urls.addPrincipals);
|
||||
// Click three times to select, unselect, then reselect (for coverage)
|
||||
await click('tbody label');
|
||||
@@ -106,7 +112,7 @@ module('Acceptance | roles | principals', function (hooks) {
|
||||
// Remove a principal to populate association view
|
||||
await click('tbody tr .rose-dropdown-button-danger');
|
||||
assert.equal(findAll('tbody tr').length, principalsCount - 1);
|
||||
await click('.rose-layout-page-actions a')
|
||||
await click('.rose-layout-page-actions a');
|
||||
assert.equal(currentURL(), urls.addPrincipals);
|
||||
await click('tbody label');
|
||||
await click('form [type="button"]');
|
||||
|
||||
@@ -26,7 +26,7 @@ module('Acceptance | scopes', function (hooks) {
|
||||
org2: null,
|
||||
project: null,
|
||||
project2: null,
|
||||
}
|
||||
},
|
||||
};
|
||||
const urls = {
|
||||
globalScope: null,
|
||||
@@ -91,9 +91,7 @@ module('Acceptance | scopes', function (hooks) {
|
||||
assert.expect(1);
|
||||
this.server.get('/scopes/:id', ({ scopes }, { params: { id } }) => {
|
||||
const scope = scopes.find(id);
|
||||
const response = (id === 'global')
|
||||
? new Response(404)
|
||||
: scope;
|
||||
const response = id === 'global' ? new Response(404) : scope;
|
||||
return response;
|
||||
});
|
||||
await visit(urls.globalScope);
|
||||
@@ -128,7 +126,9 @@ module('Acceptance | scopes', function (hooks) {
|
||||
await visit(urls.projectScope);
|
||||
await a11yAudit();
|
||||
assert.equal(currentURL(), urls.projectScopeEdit);
|
||||
await click('.rose-header-nav .rose-dropdown + .rose-dropdown a:nth-child(2)');
|
||||
await click(
|
||||
'.rose-header-nav .rose-dropdown + .rose-dropdown a:nth-child(2)'
|
||||
);
|
||||
assert.equal(currentURL(), urls.project2ScopeEdit);
|
||||
});
|
||||
|
||||
@@ -193,7 +193,10 @@ module('Acceptance | scopes', function (hooks) {
|
||||
});
|
||||
await visit(urls.newOrgScope);
|
||||
await click('[type="submit"]');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'The request was invalid.');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.'
|
||||
@@ -208,7 +211,10 @@ module('Acceptance | scopes', function (hooks) {
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('.rose-form-actions [type="submit"]');
|
||||
assert.equal(currentURL(), urls.orgScopeEdit);
|
||||
assert.equal(this.server.schema.scopes.where({ type: 'org' }).models[0].name, 'random string');
|
||||
assert.equal(
|
||||
this.server.schema.scopes.where({ type: 'org' }).models[0].name,
|
||||
'random string'
|
||||
);
|
||||
});
|
||||
|
||||
test('can cancel changes to existing scope', async function (assert) {
|
||||
@@ -246,7 +252,10 @@ module('Acceptance | scopes', function (hooks) {
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'The request was invalid.');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.'
|
||||
@@ -268,7 +277,10 @@ module('Acceptance | scopes', function (hooks) {
|
||||
assert.ok(find('.rose-dialog'));
|
||||
await click('.rose-dialog-footer button:first-child');
|
||||
assert.equal(currentURL(), urls.globalScope);
|
||||
assert.notEqual(this.server.schema.scopes.where({ type: 'org' }).models[0].name, 'random string');
|
||||
assert.notEqual(
|
||||
this.server.schema.scopes.where({ type: 'org' }).models[0].name,
|
||||
'random string'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -287,7 +299,10 @@ module('Acceptance | scopes', function (hooks) {
|
||||
assert.ok(find('.rose-dialog'));
|
||||
await click('.rose-dialog-footer button:last-child');
|
||||
assert.equal(currentURL(), urls.orgScopeEdit);
|
||||
assert.notEqual(this.server.schema.scopes.where({ type: 'org' }).models[0].name, 'random string');
|
||||
assert.notEqual(
|
||||
this.server.schema.scopes.where({ type: 'org' }).models[0].name,
|
||||
'random string'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -340,5 +355,4 @@ module('Acceptance | scopes', function (hooks) {
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'Oops.');
|
||||
});
|
||||
|
||||
});
|
||||
@@ -39,13 +39,33 @@ module('Acceptance | sessions', function (hooks) {
|
||||
type: 'project',
|
||||
scope: { id: instances.scopes.org.id, type: instances.scopes.org.type },
|
||||
});
|
||||
this.server.createList('group', 1, { scope: instances.scopes.org }, 'withMembers');
|
||||
this.server.createList('host-catalog', 1, { scope: instances.scopes.project }, 'withChildren');
|
||||
this.server.createList('target', 1, { scope: instances.scopes.project }, 'withRandomHostSets');
|
||||
instances.sessions = this.server.createList('session', 3, {
|
||||
scope: instances.scopes.project,
|
||||
status: 'active'
|
||||
}, 'withAssociations');
|
||||
this.server.createList(
|
||||
'group',
|
||||
1,
|
||||
{ scope: instances.scopes.org },
|
||||
'withMembers'
|
||||
);
|
||||
this.server.createList(
|
||||
'host-catalog',
|
||||
1,
|
||||
{ scope: instances.scopes.project },
|
||||
'withChildren'
|
||||
);
|
||||
this.server.createList(
|
||||
'target',
|
||||
1,
|
||||
{ scope: instances.scopes.project },
|
||||
'withRandomHostSets'
|
||||
);
|
||||
instances.sessions = this.server.createList(
|
||||
'session',
|
||||
3,
|
||||
{
|
||||
scope: instances.scopes.project,
|
||||
status: 'active',
|
||||
},
|
||||
'withAssociations'
|
||||
);
|
||||
urls.sessions = `/scopes/${instances.scopes.project.id}/sessions`;
|
||||
});
|
||||
|
||||
@@ -65,7 +85,7 @@ module('Acceptance | sessions', function (hooks) {
|
||||
assert.expect(2);
|
||||
instances.sessions[0].update({
|
||||
userId: null,
|
||||
targetId: null
|
||||
targetId: null,
|
||||
});
|
||||
authenticateSession({});
|
||||
later(async () => {
|
||||
|
||||
@@ -24,7 +24,7 @@ module('Acceptance | targets', function (hooks) {
|
||||
global: null,
|
||||
org: null,
|
||||
project: null,
|
||||
}
|
||||
},
|
||||
};
|
||||
const urls = {
|
||||
globalScope: null,
|
||||
@@ -121,7 +121,10 @@ module('Acceptance | targets', function (hooks) {
|
||||
});
|
||||
await visit(urls.newTarget);
|
||||
await click('[type="submit"]');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'The request was invalid.');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.'
|
||||
@@ -136,7 +139,10 @@ module('Acceptance | targets', function (hooks) {
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('.rose-form-actions [type="submit"]');
|
||||
assert.equal(currentURL(), urls.target);
|
||||
assert.equal(this.server.schema.targets.all().models[0].name, 'random string');
|
||||
assert.equal(
|
||||
this.server.schema.targets.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
});
|
||||
|
||||
test('can cancel changes to existing target', async function (assert) {
|
||||
@@ -174,7 +180,10 @@ module('Acceptance | targets', function (hooks) {
|
||||
await click('form [type="button"]', 'Activate edit mode');
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('[type="submit"]');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'The request was invalid.');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.'
|
||||
@@ -196,7 +205,10 @@ module('Acceptance | targets', function (hooks) {
|
||||
assert.ok(find('.rose-dialog'));
|
||||
await click('.rose-dialog-footer button:first-child');
|
||||
assert.equal(currentURL(), urls.targets);
|
||||
assert.notEqual(this.server.schema.targets.all().models[0].name, 'random string');
|
||||
assert.notEqual(
|
||||
this.server.schema.targets.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -215,7 +227,10 @@ module('Acceptance | targets', function (hooks) {
|
||||
assert.ok(find('.rose-dialog'));
|
||||
await click('.rose-dialog-footer button:last-child');
|
||||
assert.equal(currentURL(), urls.target);
|
||||
assert.notEqual(this.server.schema.targets.all().models[0].name, 'random string');
|
||||
assert.notEqual(
|
||||
this.server.schema.targets.all().models[0].name,
|
||||
'random string'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -268,5 +283,4 @@ module('Acceptance | targets', function (hooks) {
|
||||
await click('.rose-layout-page-actions .rose-dropdown-button-danger');
|
||||
assert.ok(find('[role="alert"]').textContent.trim(), 'Oops.');
|
||||
});
|
||||
|
||||
});
|
||||
@@ -20,7 +20,7 @@ module('Acceptance | targets | host-sets', function (hooks) {
|
||||
global: null,
|
||||
org: null,
|
||||
project: null,
|
||||
}
|
||||
},
|
||||
};
|
||||
const urls = {
|
||||
globalScope: null,
|
||||
@@ -43,12 +43,16 @@ module('Acceptance | targets | host-sets', function (hooks) {
|
||||
type: 'project',
|
||||
scope: { id: instances.scopes.org.id, type: 'org' },
|
||||
});
|
||||
instances.hostCatalog = this.server.create('host-catalog', {
|
||||
scope: instances.scopes.project
|
||||
}, 'withChildren');
|
||||
instances.hostCatalog = this.server.create(
|
||||
'host-catalog',
|
||||
{
|
||||
scope: instances.scopes.project,
|
||||
},
|
||||
'withChildren'
|
||||
);
|
||||
instances.target = this.server.create('target', {
|
||||
scope: instances.scopes.project,
|
||||
hostSets: instances.hostCatalog.hostSets
|
||||
hostSets: instances.hostCatalog.hostSets,
|
||||
});
|
||||
// Generate route URLs for resources
|
||||
urls.globalScope = `/scopes/global/scopes`;
|
||||
@@ -106,7 +110,7 @@ module('Acceptance | targets | host-sets', function (hooks) {
|
||||
instances.target.update({ hostSetIds: [] });
|
||||
await visit(urls.targetHostSets);
|
||||
assert.equal(findAll('tbody tr').length, 0);
|
||||
await click('.rose-layout-page-actions a')
|
||||
await click('.rose-layout-page-actions a');
|
||||
assert.equal(currentURL(), urls.targetAddHostSets);
|
||||
// Click three times to select, unselect, then reselect (for coverage)
|
||||
await click('tbody label');
|
||||
@@ -125,7 +129,7 @@ module('Acceptance | targets | host-sets', function (hooks) {
|
||||
// first, remove a target host set (otherwise none would be available to add)
|
||||
await click('tbody tr .rose-dropdown-button-danger');
|
||||
assert.equal(findAll('tbody tr').length, targetHostSetCount - 1);
|
||||
await click('.rose-layout-page-actions a')
|
||||
await click('.rose-layout-page-actions a');
|
||||
assert.equal(currentURL(), urls.targetAddHostSets);
|
||||
await click('tbody label');
|
||||
await click('form [type="button"]');
|
||||
@@ -156,5 +160,4 @@ module('Acceptance | targets | host-sets', function (hooks) {
|
||||
assert.equal(currentURL(), urls.targetAddHostSets);
|
||||
assert.equal(instances.target.hostSets.length, 0);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -38,9 +38,13 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
type: 'org',
|
||||
scope: { id: 'global', type: 'global' },
|
||||
});
|
||||
this.server.create('auth-method', {
|
||||
scope: instances.scopes.org
|
||||
}, 'withAccountsAndUsers');
|
||||
this.server.create(
|
||||
'auth-method',
|
||||
{
|
||||
scope: instances.scopes.org,
|
||||
},
|
||||
'withAccountsAndUsers'
|
||||
);
|
||||
instances.user = this.server.schema.users.all().models[0];
|
||||
accountsCount = instances.user.accountIds.length;
|
||||
urls.users = `/scopes/${instances.scopes.org.id}/users`;
|
||||
@@ -85,7 +89,7 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
assert.ok(find('[role="alert"]'));
|
||||
});
|
||||
|
||||
test('visiting account add accounts', async function(assert) {
|
||||
test('visiting account add accounts', async function (assert) {
|
||||
assert.expect(1);
|
||||
await visit(urls.addAccounts);
|
||||
await a11yAudit();
|
||||
@@ -114,7 +118,7 @@ module('Acceptance | users | accounts', function (hooks) {
|
||||
assert.equal(findAll('tbody tr').length, accountsCount);
|
||||
await click('tbody tr .rose-dropdown-button-danger');
|
||||
assert.equal(findAll('tbody tr').length, accountsCount - 1);
|
||||
await click('.rose-layout-page-actions a')
|
||||
await click('.rose-layout-page-actions a');
|
||||
assert.equal(currentURL(), urls.addAccounts);
|
||||
await click('tbody label');
|
||||
await click('form [type="button"]');
|
||||
|
||||
@@ -3,11 +3,13 @@ import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | copyable', function(hooks) {
|
||||
module('Integration | Component | copyable', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function(assert) {
|
||||
await render(hbs`<Copyable @buttonText="Copy me" @text="foo">text</Copyable>`);
|
||||
test('it renders', async function (assert) {
|
||||
await render(
|
||||
hbs`<Copyable @buttonText="Copy me" @text="foo">text</Copyable>`
|
||||
);
|
||||
assert.ok(find('.copyable'));
|
||||
assert.equal(find('.copyable-content').textContent.trim(), 'text');
|
||||
assert.equal(find('.copyable-button').textContent.trim(), 'Copy me');
|
||||
|
||||
@@ -3,10 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | doc-link', function(hooks) {
|
||||
module('Integration | Component | doc-link', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function(assert) {
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(1);
|
||||
await render(hbs`<DocLink @doc="account" @iconSize="large" />`);
|
||||
assert.ok(find('.doc-link .rose-icon.large'));
|
||||
|
||||
@@ -54,7 +54,10 @@ module('Integration | Component | error/message', function (hooks) {
|
||||
find('.rose-message-title').textContent.trim(),
|
||||
'Something went wrong'
|
||||
);
|
||||
assert.equal(find('.rose-message-subtitle').textContent.trim(), 'Error 599');
|
||||
assert.equal(
|
||||
find('.rose-message-subtitle').textContent.trim(),
|
||||
'Error 599'
|
||||
);
|
||||
assert.equal(
|
||||
find('.rose-message-description').textContent.trim(),
|
||||
'Please contact your administrator or try again later.'
|
||||
|
||||
@@ -3,10 +3,10 @@ import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, findAll, click } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | pending-confirmations', function(hooks) {
|
||||
module('Integration | Component | pending-confirmations', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders pending confirmations', async function(assert) {
|
||||
test('it renders pending confirmations', async function (assert) {
|
||||
assert.expect(2);
|
||||
const service = this.owner.lookup('service:confirm');
|
||||
service.enabled = true;
|
||||
@@ -25,7 +25,7 @@ module('Integration | Component | pending-confirmations', function(hooks) {
|
||||
assert.equal(findAll('.pending').length, 1, 'One pending confirmations');
|
||||
});
|
||||
|
||||
test('it exposes a confirm action that confirms the confirmation', async function(assert) {
|
||||
test('it exposes a confirm action that confirms the confirmation', async function (assert) {
|
||||
assert.expect(3);
|
||||
const service = this.owner.lookup('service:confirm');
|
||||
service.enabled = true;
|
||||
@@ -41,7 +41,7 @@ module('Integration | Component | pending-confirmations', function(hooks) {
|
||||
assert.ok(confirmation.done, 'Confirmation is done');
|
||||
});
|
||||
|
||||
test('it exposes a dismiss action that dismisses the confirmation', async function(assert) {
|
||||
test('it exposes a dismiss action that dismisses the confirmation', async function (assert) {
|
||||
assert.expect(3);
|
||||
const service = this.owner.lookup('service:confirm');
|
||||
service.enabled = true;
|
||||
|
||||
@@ -4,10 +4,10 @@ import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
import config from 'ember-get-config';
|
||||
|
||||
module('Integration | Helper | doc-url', function(hooks) {
|
||||
module('Integration | Helper | doc-url', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders a URL generated from the documentation config', async function(assert) {
|
||||
test('it renders a URL generated from the documentation config', async function (assert) {
|
||||
assert.expect(3);
|
||||
const baseURL = config.documentation.baseURL;
|
||||
const path = config.documentation.topics.account;
|
||||
@@ -17,13 +17,12 @@ module('Integration | Helper | doc-url', function(hooks) {
|
||||
assert.equal(this.element.textContent.trim(), `${baseURL}${path}`);
|
||||
});
|
||||
|
||||
test('it throws an error if the specified documentation path cannot be found', async function(assert) {
|
||||
test('it throws an error if the specified documentation path cannot be found', async function (assert) {
|
||||
assert.expect(2);
|
||||
const helper = this.owner.lookup('helper:doc-url');
|
||||
assert.ok(helper.compute(['account']), 'Specified document exists.')
|
||||
assert.ok(helper.compute(['account']), 'Specified document exists.');
|
||||
assert.throws(() => {
|
||||
helper.compute(['no.such.doc']);
|
||||
}, 'Specified documentation was not found, so the helper threw an error.');
|
||||
});
|
||||
|
||||
});
|
||||
@@ -3,11 +3,11 @@ import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Helper | format-date-iso-human', function(hooks) {
|
||||
module('Integration | Helper | format-date-iso-human', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it renders', async function(assert) {
|
||||
test('it renders', async function (assert) {
|
||||
this.set('inputValue', new Date('2020-01-01T00:00:00.999Z'));
|
||||
|
||||
await render(hbs`{{format-date-iso-human inputValue}}`);
|
||||
|
||||
@@ -3,11 +3,11 @@ import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Helper | format-date-iso', function(hooks) {
|
||||
module('Integration | Helper | format-date-iso', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it renders', async function(assert) {
|
||||
test('it renders', async function (assert) {
|
||||
this.set('inputValue', new Date('2020-01-01T00:00:00.999Z'));
|
||||
|
||||
await render(hbs`{{format-date-iso inputValue}}`);
|
||||
|
||||
@@ -27,9 +27,12 @@ module('Unit | Authenticator | password', function (hooks) {
|
||||
test('it adds an authorization header to application adapter on restore', async function (assert) {
|
||||
assert.expect(1);
|
||||
const mockData = { id: 'token1234', token: 'token1234' };
|
||||
this.server.get(authenticator.buildTokenValidationEndpointURL(mockData.id), () => {
|
||||
return new Response(200);
|
||||
});
|
||||
this.server.get(
|
||||
authenticator.buildTokenValidationEndpointURL(mockData.id),
|
||||
() => {
|
||||
return new Response(200);
|
||||
}
|
||||
);
|
||||
authenticator.restore(mockData);
|
||||
assert.equal(applicationAdapter.headers.Authorization, 'Bearer token1234');
|
||||
});
|
||||
|
||||
+13
-8
@@ -1,12 +1,17 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/auth-methods/auth-method/accounts/account/set-password', function(hooks) {
|
||||
setupTest(hooks);
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/auth-methods/auth-method/accounts/account/set-password',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/auth-methods/auth-method/accounts/account/set-password');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/auth-methods/auth-method/accounts/account/set-password'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -1,12 +1,16 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/groups/group/members', function(hooks) {
|
||||
module('Unit | Controller | scopes/scope/groups/group/members', function (
|
||||
hooks
|
||||
) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/groups/group/members');
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/groups/group/members'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
@@ -1,11 +1,11 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/host-catalogs', function(hooks) {
|
||||
module('Unit | Controller | scopes/scope/host-catalogs', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/host-catalogs');
|
||||
assert.ok(controller);
|
||||
});
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/host-catalogs/host-catalog', function(hooks) {
|
||||
module('Unit | Controller | scopes/scope/host-catalogs/host-catalog', function (
|
||||
hooks
|
||||
) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/host-catalogs/host-catalog');
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/host-catalogs/host-catalog'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
+13
-8
@@ -1,12 +1,17 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/host-catalogs/host-catalog/host-sets', function(hooks) {
|
||||
setupTest(hooks);
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/host-catalogs/host-catalog/host-sets',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/host-catalogs/host-catalog/host-sets');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/host-catalogs/host-catalog/host-sets'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
}
|
||||
);
|
||||
+13
-8
@@ -1,12 +1,17 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/host-catalogs/host-catalog/host-sets/host-set', function(hooks) {
|
||||
setupTest(hooks);
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/host-catalogs/host-catalog/host-sets/host-set',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/host-catalogs/host-catalog/host-sets/host-set');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/host-catalogs/host-catalog/host-sets/host-set'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
}
|
||||
);
|
||||
+13
-8
@@ -1,12 +1,17 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/host-catalogs/host-catalog/host-sets/host-set/add-hosts', function(hooks) {
|
||||
setupTest(hooks);
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/host-catalogs/host-catalog/host-sets/host-set/add-hosts',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/host-catalogs/host-catalog/host-sets/host-set/add-hosts');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/host-catalogs/host-catalog/host-sets/host-set/add-hosts'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
}
|
||||
);
|
||||
+13
-8
@@ -1,12 +1,17 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/host-catalogs/host-catalog/host-sets/host-set/create-and-add-host', function(hooks) {
|
||||
setupTest(hooks);
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/host-catalogs/host-catalog/host-sets/host-set/create-and-add-host',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/host-catalogs/host-catalog/host-sets/host-set/create-and-add-host');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/host-catalogs/host-catalog/host-sets/host-set/create-and-add-host'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
}
|
||||
);
|
||||
+13
-8
@@ -1,12 +1,17 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts', function(hooks) {
|
||||
setupTest(hooks);
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
}
|
||||
);
|
||||
+13
-8
@@ -1,12 +1,17 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/host-catalogs/host-catalog/hosts', function(hooks) {
|
||||
setupTest(hooks);
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/host-catalogs/host-catalog/hosts',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/host-catalogs/host-catalog/hosts');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/host-catalogs/host-catalog/hosts'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
}
|
||||
);
|
||||
+13
-8
@@ -1,12 +1,17 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/host-catalogs/host-catalog/hosts/host', function(hooks) {
|
||||
setupTest(hooks);
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/host-catalogs/host-catalog/hosts/host',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/host-catalogs/host-catalog/hosts/host');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/host-catalogs/host-catalog/hosts/host'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -1,12 +1,14 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/roles/role/grants', function(hooks) {
|
||||
module('Unit | Controller | scopes/scope/roles/role/grants', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/roles/role/grants');
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/roles/role/grants'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
@@ -1,12 +1,16 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/roles/role/principals', function(hooks) {
|
||||
module('Unit | Controller | scopes/scope/roles/role/principals', function (
|
||||
hooks
|
||||
) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/roles/role/principals');
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/roles/role/principals'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
@@ -1,11 +1,11 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/scopes', function(hooks) {
|
||||
module('Unit | Controller | scopes/scope/scopes', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/scopes');
|
||||
assert.ok(controller);
|
||||
});
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/sessions', function(hooks) {
|
||||
module('Unit | Controller | scopes/scope/sessions', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/sessions');
|
||||
assert.ok(controller);
|
||||
});
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/targets', function(hooks) {
|
||||
module('Unit | Controller | scopes/scope/targets', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/targets');
|
||||
assert.ok(controller);
|
||||
});
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/targets/target', function(hooks) {
|
||||
module('Unit | Controller | scopes/scope/targets/target', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/targets/target');
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/targets/target'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
@@ -1,12 +1,17 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/targets/target/add-host-sets', function(hooks) {
|
||||
setupTest(hooks);
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/targets/target/add-host-sets',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/targets/target/add-host-sets');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/targets/target/add-host-sets'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
}
|
||||
);
|
||||
Loaded 100 of 160 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user