refactor: 💡 Refactor accounts to members
This commit is contained in:
1 parent
9e005a73bb
commit
21a70217f4
7 files changed
+17
-17
No files matched your search
+2
-2
@@ -1,7 +1,7 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsNewController extends Controller {
|
||||
export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsMembersController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@@ -12,6 +12,6 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsNewController
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('titles.new');
|
||||
return this.intl.t('resources.member.title_plural');
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{{page-title (t 'resources.account.title_plural')}}
|
||||
|
||||
{{outlet}}
|
||||
+1
-1
@@ -9,4 +9,4 @@
|
||||
>
|
||||
{{t 'resources.member.title_plural'}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Tabs>
|
||||
</Rose::Nav::Tabs>
|
||||
+1
-1
@@ -59,4 +59,4 @@
|
||||
</message.description>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
@@ -0,0 +1,3 @@
|
||||
{{page-title (t 'resources.member.title_plural')}}
|
||||
|
||||
{{outlet}}
|
||||
+8
-8
@@ -10,7 +10,7 @@ import {
|
||||
//invalidateSession,
|
||||
} from 'ember-simple-auth/test-support';
|
||||
|
||||
module('Acceptance | managed-groups | accounts', function (hooks) {
|
||||
module('Acceptance | managed-groups | members', function (hooks) {
|
||||
setupApplicationTest(hooks);
|
||||
setupMirage(hooks);
|
||||
|
||||
@@ -28,7 +28,7 @@ module('Acceptance | managed-groups | accounts', function (hooks) {
|
||||
authMethods: null,
|
||||
managedGroups: null,
|
||||
managedGroup: null,
|
||||
managedGroupAccounts: null,
|
||||
managedGroupMembers: null,
|
||||
};
|
||||
|
||||
hooks.beforeEach(function () {
|
||||
@@ -54,16 +54,16 @@ module('Acceptance | managed-groups | accounts', function (hooks) {
|
||||
urls.authMethod = `${urls.authMethods}/${instances.authMethod.id}`;
|
||||
urls.managedGroups = `${urls.authMethod}/managed-groups`;
|
||||
urls.managedGroup = `${urls.managedGroups}/${instances.managedGroup.id}`;
|
||||
urls.managedGroupAccounts = `${urls.managedGroup}/accounts`;
|
||||
urls.managedGroupMembers = `${urls.managedGroup}/members`;
|
||||
});
|
||||
|
||||
test('User can navigate to index', async function (assert) {
|
||||
assert.expect(3);
|
||||
const accountsCount = instances.managedGroup.memberIds.length;
|
||||
await visit(urls.managedGroupAccounts);
|
||||
const membersCount = instances.managedGroup.memberIds.length;
|
||||
await visit(urls.managedGroupMembers);
|
||||
await a11yAudit();
|
||||
assert.equal(currentURL(), urls.managedGroupAccounts);
|
||||
assert.ok(accountsCount);
|
||||
assert.equal(findAll('tbody tr').length, accountsCount);
|
||||
assert.equal(currentURL(), urls.managedGroupMembers);
|
||||
assert.ok(membersCount);
|
||||
assert.equal(findAll('tbody tr').length, membersCount);
|
||||
});
|
||||
});
|
||||
+2
-2
@@ -2,14 +2,14 @@ import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module(
|
||||
'Unit | Controller | scopes/scope/auth-methods/auth-method/managed-groups/new',
|
||||
'Unit | Controller | scopes/scope/auth-methods/auth-method/managed-groups/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/auth-methods/auth-method/managed-groups/new'
|
||||
'controller:scopes/scope/auth-methods/auth-method/managed-groups/members'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
Reference in new issue
Block a user