diff options
Diffstat (limited to 'spec/frontend/admin')
-rw-r--r-- | spec/frontend/admin/broadcast_messages/components/message_form_spec.js | 6 | ||||
-rw-r--r-- | spec/frontend/admin/users/components/user_date_spec.js | 2 | ||||
-rw-r--r-- | spec/frontend/admin/users/mock_data.js | 8 |
3 files changed, 12 insertions, 4 deletions
diff --git a/spec/frontend/admin/broadcast_messages/components/message_form_spec.js b/spec/frontend/admin/broadcast_messages/components/message_form_spec.js index 88ea79f38b3..36c0ac303ba 100644 --- a/spec/frontend/admin/broadcast_messages/components/message_form_spec.js +++ b/spec/frontend/admin/broadcast_messages/components/message_form_spec.js @@ -3,7 +3,7 @@ import { GlBroadcastMessage, GlForm } from '@gitlab/ui'; import AxiosMockAdapter from 'axios-mock-adapter'; import { createAlert } from '~/flash'; import axios from '~/lib/utils/axios_utils'; -import httpStatus from '~/lib/utils/http_status'; +import { HTTP_STATUS_BAD_REQUEST } from '~/lib/utils/http_status'; import MessageForm from '~/admin/broadcast_messages/components/message_form.vue'; import { BROADCAST_MESSAGES_PATH, @@ -160,7 +160,7 @@ describe('MessageForm', () => { it('shows an error alert if the create request fails', async () => { createComponent({ broadcastMessage: { id: undefined } }); - axiosMock.onPost(BROADCAST_MESSAGES_PATH).replyOnce(httpStatus.BAD_REQUEST); + axiosMock.onPost(BROADCAST_MESSAGES_PATH).replyOnce(HTTP_STATUS_BAD_REQUEST); findForm().vm.$emit('submit', { preventDefault: () => {} }); await waitForPromises(); @@ -187,7 +187,7 @@ describe('MessageForm', () => { it('shows an error alert if the update request fails', async () => { const id = 1337; createComponent({ broadcastMessage: { id } }); - axiosMock.onPost(`${BROADCAST_MESSAGES_PATH}/${id}`).replyOnce(httpStatus.BAD_REQUEST); + axiosMock.onPost(`${BROADCAST_MESSAGES_PATH}/${id}`).replyOnce(HTTP_STATUS_BAD_REQUEST); findForm().vm.$emit('submit', { preventDefault: () => {} }); await waitForPromises(); diff --git a/spec/frontend/admin/users/components/user_date_spec.js b/spec/frontend/admin/users/components/user_date_spec.js index af262c6d3f0..73be33d5a9d 100644 --- a/spec/frontend/admin/users/components/user_date_spec.js +++ b/spec/frontend/admin/users/components/user_date_spec.js @@ -24,7 +24,7 @@ describe('FormatDate component', () => { it.each` date | dateFormat | output - ${mockDate} | ${undefined} | ${'13 Nov, 2020'} + ${mockDate} | ${undefined} | ${'Nov 13, 2020'} ${null} | ${undefined} | ${'Never'} ${undefined} | ${undefined} | ${'Never'} ${mockDate} | ${ISO_SHORT_FORMAT} | ${'2020-11-13'} diff --git a/spec/frontend/admin/users/mock_data.js b/spec/frontend/admin/users/mock_data.js index 193ac3fa043..17cddebfcaf 100644 --- a/spec/frontend/admin/users/mock_data.js +++ b/spec/frontend/admin/users/mock_data.js @@ -62,3 +62,11 @@ export const userDeletionObstacles = [ { name: 'schedule1', type: OBSTACLE_TYPES.oncallSchedules }, { name: 'policy1', type: OBSTACLE_TYPES.escalationPolicies }, ]; + +export const userStatus = { + emoji: 'basketball', + message: 'test', + availability: 'busy', + message_html: 'test', + clear_status_at: '2023-01-04T10:00:00.000Z', +}; |