diff options
Diffstat (limited to 'spec/frontend/admin/users/components/users_table_spec.js')
-rw-r--r-- | spec/frontend/admin/users/components/users_table_spec.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/frontend/admin/users/components/users_table_spec.js b/spec/frontend/admin/users/components/users_table_spec.js index 9ff5961c7ec..ad1c45495b5 100644 --- a/spec/frontend/admin/users/components/users_table_spec.js +++ b/spec/frontend/admin/users/components/users_table_spec.js @@ -3,6 +3,7 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; import createMockApollo from 'helpers/mock_apollo_helper'; +import waitForPromises from 'helpers/wait_for_promises'; import { mountExtended } from 'helpers/vue_test_utils_helper'; import AdminUserActions from '~/admin/users/components/user_actions.vue'; @@ -106,8 +107,9 @@ describe('AdminUsersTable component', () => { }); describe('when the data has been fetched', () => { - beforeEach(() => { + beforeEach(async () => { initComponent(); + await waitForPromises(); }); it("renders the user's group count", () => { @@ -115,8 +117,9 @@ describe('AdminUsersTable component', () => { }); describe("and a user's group count is null", () => { - beforeEach(() => { + beforeEach(async () => { initComponent({}, createFetchGroupCount([{ id: user.id, groupCount: null }])); + await waitForPromises(); }); it("renders the user's group count as 0", () => { @@ -126,12 +129,12 @@ describe('AdminUsersTable component', () => { }); describe('when there is an error while fetching the data', () => { - beforeEach(() => { + beforeEach(async () => { initComponent({}, fetchGroupCountsError); + await waitForPromises(); }); it('creates a flash message and captures the error', () => { - expect(createFlash).toHaveBeenCalledTimes(1); expect(createFlash).toHaveBeenCalledWith({ message: 'Could not load user group counts. Please refresh the page to try again.', captureError: true, |