Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Improve brittle admin user API test #4334

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions test/api/admin/requests/user.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('Admin - Users API', () => {
Organization.truncate({ force: true, cascade: true }),
OrganizationRole.truncate({ force: true, cascade: true }),
User.truncate({ force: true, cascade: true }),
UAAIdentity.truncate({ force: true, cascade: true }),
])
);

Expand Down Expand Up @@ -72,10 +73,10 @@ describe('Admin - Users API', () => {

it('returns all users', async () => {
const user1 = await factory.user();
createUAAIdentity({uaaId: 'user_id_1', email: 'user1@example.com', userId: user1.id });
await createUAAIdentity({uaaId: 'user_id_1', email: 'user1@example.com', userId: user1.id });

const user2 = await factory.user();
createUAAIdentity({uaaId: 'user_id_2', email: 'user2@example.com', userId: user2.id });
await createUAAIdentity({uaaId: 'user_id_2', email: 'user2@example.com', userId: user2.id });

const org1 = await factory.organization.create();
const org2 = await factory.organization.create();
Expand Down Expand Up @@ -120,10 +121,10 @@ describe('Admin - Users API', () => {

it('returns all users with UAA identities', async () => {
const user1 = await factory.user();
createUAAIdentity({uaaId: 'user_id_1', email: 'user1@example.com', userId: user1.id });
await createUAAIdentity({uaaId: 'user_id_1', email: 'user1@example.com', userId: user1.id });

const user2 = await factory.user();
createUAAIdentity({uaaId: 'user_id_2', email: 'user2@example.com', userId: user2.id });
await createUAAIdentity({uaaId: 'user_id_2', email: 'user2@example.com', userId: user2.id });

const user3 = await factory.user();
const user4 = await factory.user();
Expand Down Expand Up @@ -165,10 +166,10 @@ describe('Admin - Users API', () => {

it('returns all users with UAA identities', async () => {
const user1 = await factory.user();
createUAAIdentity({uaaId: 'user_id_1', email: 'user1@example.com', userId: user1.id });
await createUAAIdentity({uaaId: 'user_id_1', email: 'user1@example.com', userId: user1.id });

const user2 = await factory.user();
createUAAIdentity({uaaId: 'user_id_2', email: 'user2@example.com', userId: user2.id });
await createUAAIdentity({uaaId: 'user_id_2', email: 'user2@example.com', userId: user2.id });

const user3 = await factory.user();
const user4 = await factory.user();
Expand Down
Loading