diff options
Diffstat (limited to 'spec/frontend/vue_shared/components/filtered_search_bar/tokens')
-rw-r--r-- | spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js | 18 | ||||
-rw-r--r-- | spec/frontend/vue_shared/components/filtered_search_bar/tokens/branch_token_spec.js | 4 | ||||
-rw-r--r-- | spec/frontend/vue_shared/components/filtered_search_bar/tokens/crm_contact_token_spec.js | 10 | ||||
-rw-r--r-- | spec/frontend/vue_shared/components/filtered_search_bar/tokens/crm_organization_token_spec.js | 10 | ||||
-rw-r--r-- | spec/frontend/vue_shared/components/filtered_search_bar/tokens/emoji_token_spec.js | 14 | ||||
-rw-r--r-- | spec/frontend/vue_shared/components/filtered_search_bar/tokens/label_token_spec.js | 12 | ||||
-rw-r--r-- | spec/frontend/vue_shared/components/filtered_search_bar/tokens/user_token_spec.js (renamed from spec/frontend/vue_shared/components/filtered_search_bar/tokens/author_token_spec.js) | 104 |
7 files changed, 86 insertions, 86 deletions
diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js index a0126c2bd63..164235e4bb9 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/base_token_spec.js @@ -12,12 +12,12 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { mockRegularLabel, mockLabels, -} from 'jest/vue_shared/components/sidebar/labels_select_vue/mock_data'; +} from 'jest/sidebar/components/labels/labels_select_vue/mock_data'; import { - DEFAULT_NONE_ANY, + OPTIONS_NONE_ANY, OPERATOR_IS, - OPERATOR_IS_NOT, + OPERATOR_NOT, } from '~/vue_shared/components/filtered_search_bar/constants'; import { getRecentlyUsedSuggestions, @@ -76,7 +76,7 @@ const mockProps = { active: false, suggestions: [], suggestionsLoading: false, - defaultSuggestions: DEFAULT_NONE_ANY, + defaultSuggestions: OPTIONS_NONE_ANY, getActiveTokenValue: (labels, data) => labels.find((label) => label.title === data), cursorPosition: 'start', }; @@ -301,13 +301,13 @@ describe('BaseToken', () => { describe('with default suggestions', () => { describe.each` - operator | shouldRenderFilteredSearchSuggestion - ${OPERATOR_IS} | ${true} - ${OPERATOR_IS_NOT} | ${false} + operator | shouldRenderFilteredSearchSuggestion + ${OPERATOR_IS} | ${true} + ${OPERATOR_NOT} | ${false} `('when operator is $operator', ({ shouldRenderFilteredSearchSuggestion, operator }) => { beforeEach(() => { const props = { - defaultSuggestions: DEFAULT_NONE_ANY, + defaultSuggestions: OPTIONS_NONE_ANY, value: { data: '', operator }, }; @@ -322,7 +322,7 @@ describe('BaseToken', () => { if (shouldRenderFilteredSearchSuggestion) { expect(filteredSearchSuggestions.map((c) => c.props())).toMatchObject( - DEFAULT_NONE_ANY.map((opt) => ({ value: opt.value })), + OPTIONS_NONE_ANY.map((opt) => ({ value: opt.value })), ); } else { expect(filteredSearchSuggestions).toHaveLength(0); diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/branch_token_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/branch_token_spec.js index 05b42011fe1..311d5a13280 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/branch_token_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/branch_token_spec.js @@ -11,7 +11,7 @@ import waitForPromises from 'helpers/wait_for_promises'; import { createAlert } from '~/flash'; import axios from '~/lib/utils/axios_utils'; -import { DEFAULT_NONE_ANY } from '~/vue_shared/components/filtered_search_bar/constants'; +import { OPTIONS_NONE_ANY } from '~/vue_shared/components/filtered_search_bar/constants'; import BranchToken from '~/vue_shared/components/filtered_search_bar/tokens/branch_token.vue'; import { mockBranches, mockBranchToken } from '../mock_data'; @@ -112,7 +112,7 @@ describe('BranchToken', () => { }); describe('template', () => { - const defaultBranches = DEFAULT_NONE_ANY; + const defaultBranches = OPTIONS_NONE_ANY; async function showSuggestions() { const tokenSegments = wrapper.findAllComponents(GlFilteredSearchTokenSegment); const suggestionsSegment = tokenSegments.at(2); diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/crm_contact_token_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/crm_contact_token_spec.js index 5b744521979..7be7035a0f2 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/crm_contact_token_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/crm_contact_token_spec.js @@ -10,7 +10,7 @@ import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; import { createAlert } from '~/flash'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; -import { DEFAULT_NONE_ANY } from '~/vue_shared/components/filtered_search_bar/constants'; +import { OPTIONS_NONE_ANY } from '~/vue_shared/components/filtered_search_bar/constants'; import BaseToken from '~/vue_shared/components/filtered_search_bar/tokens/base_token.vue'; import CrmContactToken from '~/vue_shared/components/filtered_search_bar/tokens/crm_contact_token.vue'; import searchCrmContactsQuery from '~/vue_shared/components/filtered_search_bar/queries/search_crm_contacts.query.graphql'; @@ -187,7 +187,7 @@ describe('CrmContactToken', () => { }); describe('template', () => { - const defaultContacts = DEFAULT_NONE_ANY; + const defaultContacts = OPTIONS_NONE_ANY; it('renders base-token component', () => { mountComponent({ @@ -250,7 +250,7 @@ describe('CrmContactToken', () => { expect(wrapper.findComponent(GlDropdownDivider).exists()).toBe(false); }); - it('renders `DEFAULT_NONE_ANY` as default suggestions', () => { + it('renders `OPTIONS_NONE_ANY` as default suggestions', () => { mountComponent({ active: true, config: { ...mockCrmContactToken }, @@ -262,8 +262,8 @@ describe('CrmContactToken', () => { const suggestions = wrapper.findAllComponents(GlFilteredSearchSuggestion); - expect(suggestions).toHaveLength(DEFAULT_NONE_ANY.length); - DEFAULT_NONE_ANY.forEach((contact, index) => { + expect(suggestions).toHaveLength(OPTIONS_NONE_ANY.length); + OPTIONS_NONE_ANY.forEach((contact, index) => { expect(suggestions.at(index).text()).toBe(contact.text); }); }); diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/crm_organization_token_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/crm_organization_token_spec.js index 3a3e96032e8..ecd3e8a04f1 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/crm_organization_token_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/crm_organization_token_spec.js @@ -10,7 +10,7 @@ import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; import { createAlert } from '~/flash'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; -import { DEFAULT_NONE_ANY } from '~/vue_shared/components/filtered_search_bar/constants'; +import { OPTIONS_NONE_ANY } from '~/vue_shared/components/filtered_search_bar/constants'; import BaseToken from '~/vue_shared/components/filtered_search_bar/tokens/base_token.vue'; import CrmOrganizationToken from '~/vue_shared/components/filtered_search_bar/tokens/crm_organization_token.vue'; import searchCrmOrganizationsQuery from '~/vue_shared/components/filtered_search_bar/queries/search_crm_organizations.query.graphql'; @@ -186,7 +186,7 @@ describe('CrmOrganizationToken', () => { }); describe('template', () => { - const defaultOrganizations = DEFAULT_NONE_ANY; + const defaultOrganizations = OPTIONS_NONE_ANY; it('renders base-token component', () => { mountComponent({ @@ -249,7 +249,7 @@ describe('CrmOrganizationToken', () => { expect(wrapper.findComponent(GlDropdownDivider).exists()).toBe(false); }); - it('renders `DEFAULT_NONE_ANY` as default suggestions', () => { + it('renders `OPTIONS_NONE_ANY` as default suggestions', () => { mountComponent({ active: true, config: { ...mockCrmOrganizationToken }, @@ -261,8 +261,8 @@ describe('CrmOrganizationToken', () => { const suggestions = wrapper.findAllComponents(GlFilteredSearchSuggestion); - expect(suggestions).toHaveLength(DEFAULT_NONE_ANY.length); - DEFAULT_NONE_ANY.forEach((organization, index) => { + expect(suggestions).toHaveLength(OPTIONS_NONE_ANY.length); + OPTIONS_NONE_ANY.forEach((organization, index) => { expect(suggestions.at(index).text()).toBe(organization.text); }); }); diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/emoji_token_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/emoji_token_spec.js index e8436d2db17..773df01ada7 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/emoji_token_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/emoji_token_spec.js @@ -12,9 +12,9 @@ import { createAlert } from '~/flash'; import axios from '~/lib/utils/axios_utils'; import { - DEFAULT_LABEL_NONE, - DEFAULT_LABEL_ANY, - DEFAULT_NONE_ANY, + OPTION_NONE, + OPTION_ANY, + OPTIONS_NONE_ANY, } from '~/vue_shared/components/filtered_search_bar/constants'; import EmojiToken from '~/vue_shared/components/filtered_search_bar/tokens/emoji_token.vue'; @@ -118,7 +118,7 @@ describe('EmojiToken', () => { }); describe('template', () => { - const defaultEmojis = DEFAULT_NONE_ANY; + const defaultEmojis = OPTIONS_NONE_ANY; beforeEach(async () => { wrapper = createComponent({ @@ -181,7 +181,7 @@ describe('EmojiToken', () => { expect(wrapper.findComponent(GlDropdownDivider).exists()).toBe(false); }); - it('renders `DEFAULT_LABEL_NONE` and `DEFAULT_LABEL_ANY` as default suggestions', async () => { + it('renders `OPTION_NONE` and `OPTION_ANY` as default suggestions', async () => { wrapper = createComponent({ active: true, config: { ...mockReactionEmojiToken }, @@ -195,8 +195,8 @@ describe('EmojiToken', () => { const suggestions = wrapper.findAllComponents(GlFilteredSearchSuggestion); expect(suggestions).toHaveLength(2); - expect(suggestions.at(0).text()).toBe(DEFAULT_LABEL_NONE.text); - expect(suggestions.at(1).text()).toBe(DEFAULT_LABEL_ANY.text); + expect(suggestions.at(0).text()).toBe(OPTION_NONE.text); + expect(suggestions.at(1).text()).toBe(OPTION_ANY.text); }); }); }); diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/label_token_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/label_token_spec.js index 8ca12afacec..9d96123c17f 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/label_token_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/label_token_spec.js @@ -10,11 +10,11 @@ import waitForPromises from 'helpers/wait_for_promises'; import { mockRegularLabel, mockLabels, -} from 'jest/vue_shared/components/sidebar/labels_select_vue/mock_data'; +} from 'jest/sidebar/components/labels/labels_select_vue/mock_data'; import { createAlert } from '~/flash'; import axios from '~/lib/utils/axios_utils'; -import { DEFAULT_NONE_ANY } from '~/vue_shared/components/filtered_search_bar/constants'; +import { OPTIONS_NONE_ANY } from '~/vue_shared/components/filtered_search_bar/constants'; import BaseToken from '~/vue_shared/components/filtered_search_bar/tokens/base_token.vue'; import LabelToken from '~/vue_shared/components/filtered_search_bar/tokens/label_token.vue'; @@ -141,7 +141,7 @@ describe('LabelToken', () => { }); describe('template', () => { - const defaultLabels = DEFAULT_NONE_ANY; + const defaultLabels = OPTIONS_NONE_ANY; beforeEach(async () => { wrapper = createComponent({ value: { data: `"${mockRegularLabel.title}"` } }); @@ -209,7 +209,7 @@ describe('LabelToken', () => { expect(wrapper.findComponent(GlDropdownDivider).exists()).toBe(false); }); - it('renders `DEFAULT_NONE_ANY` as default suggestions', () => { + it('renders `OPTIONS_NONE_ANY` as default suggestions', () => { wrapper = createComponent({ active: true, config: { ...mockLabelToken }, @@ -221,8 +221,8 @@ describe('LabelToken', () => { const suggestions = wrapper.findAllComponents(GlFilteredSearchSuggestion); - expect(suggestions).toHaveLength(DEFAULT_NONE_ANY.length); - DEFAULT_NONE_ANY.forEach((label, index) => { + expect(suggestions).toHaveLength(OPTIONS_NONE_ANY.length); + OPTIONS_NONE_ANY.forEach((label, index) => { expect(suggestions.at(index).text()).toBe(label.text); }); }); diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/author_token_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/user_token_spec.js index 5371b9af475..32cb74d5f80 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/tokens/author_token_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/tokens/user_token_spec.js @@ -11,11 +11,11 @@ import waitForPromises from 'helpers/wait_for_promises'; import { createAlert } from '~/flash'; import axios from '~/lib/utils/axios_utils'; -import { DEFAULT_NONE_ANY } from '~/vue_shared/components/filtered_search_bar/constants'; -import AuthorToken from '~/vue_shared/components/filtered_search_bar/tokens/author_token.vue'; +import { OPTIONS_NONE_ANY } from '~/vue_shared/components/filtered_search_bar/constants'; +import UserToken from '~/vue_shared/components/filtered_search_bar/tokens/user_token.vue'; import BaseToken from '~/vue_shared/components/filtered_search_bar/tokens/base_token.vue'; -import { mockAuthorToken, mockAuthors } from '../mock_data'; +import { mockAuthorToken, mockUsers } from '../mock_data'; jest.mock('~/flash'); const defaultStubs = { @@ -28,7 +28,7 @@ const defaultStubs = { }, }; -const mockPreloadedAuthors = [ +const mockPreloadedUsers = [ { id: 13, name: 'Administrator', @@ -46,7 +46,7 @@ function createComponent(options = {}) { data = {}, listeners = {}, } = options; - return mount(AuthorToken, { + return mount(UserToken, { propsData: { config, value, @@ -66,7 +66,7 @@ function createComponent(options = {}) { }); } -describe('AuthorToken', () => { +describe('UserToken', () => { const originalGon = window.gon; const currentUserLength = 1; let mock; @@ -85,40 +85,40 @@ describe('AuthorToken', () => { }); describe('methods', () => { - describe('fetchAuthors', () => { + describe('fetchUsers', () => { beforeEach(() => { wrapper = createComponent(); }); - it('calls `config.fetchAuthors` with provided searchTerm param', () => { - jest.spyOn(wrapper.vm.config, 'fetchAuthors'); + it('calls `config.fetchUsers` with provided searchTerm param', () => { + jest.spyOn(wrapper.vm.config, 'fetchUsers'); - getBaseToken().vm.$emit('fetch-suggestions', mockAuthors[0].username); + getBaseToken().vm.$emit('fetch-suggestions', mockUsers[0].username); - expect(wrapper.vm.config.fetchAuthors).toHaveBeenCalledWith( + expect(wrapper.vm.config.fetchUsers).toHaveBeenCalledWith( mockAuthorToken.fetchPath, - mockAuthors[0].username, + mockUsers[0].username, ); }); - it('sets response to `authors` when request is succesful', () => { - jest.spyOn(wrapper.vm.config, 'fetchAuthors').mockResolvedValue(mockAuthors); + it('sets response to `users` when request is successful', () => { + jest.spyOn(wrapper.vm.config, 'fetchUsers').mockResolvedValue(mockUsers); getBaseToken().vm.$emit('fetch-suggestions', 'root'); return waitForPromises().then(() => { - expect(getBaseToken().props('suggestions')).toEqual(mockAuthors); + expect(getBaseToken().props('suggestions')).toEqual(mockUsers); }); }); // TODO: rm when completed https://gitlab.com/gitlab-org/gitlab/-/issues/345756 describe('when there are null users presents', () => { - const mockAuthorsWithNullUser = mockAuthors.concat([null]); + const mockUsersWithNullUser = mockUsers.concat([null]); beforeEach(() => { jest - .spyOn(wrapper.vm.config, 'fetchAuthors') - .mockResolvedValue({ data: mockAuthorsWithNullUser }); + .spyOn(wrapper.vm.config, 'fetchUsers') + .mockResolvedValue({ data: mockUsersWithNullUser }); getBaseToken().vm.$emit('fetch-suggestions', 'root'); }); @@ -126,7 +126,7 @@ describe('AuthorToken', () => { describe('when res.data is present', () => { it('filters the successful response when null values are present', () => { return waitForPromises().then(() => { - expect(getBaseToken().props('suggestions')).toEqual(mockAuthors); + expect(getBaseToken().props('suggestions')).toEqual(mockUsers); }); }); }); @@ -134,14 +134,14 @@ describe('AuthorToken', () => { describe('when response is an array', () => { it('filters the successful response when null values are present', () => { return waitForPromises().then(() => { - expect(getBaseToken().props('suggestions')).toEqual(mockAuthors); + expect(getBaseToken().props('suggestions')).toEqual(mockUsers); }); }); }); }); it('calls `createAlert` with flash error message when request fails', () => { - jest.spyOn(wrapper.vm.config, 'fetchAuthors').mockRejectedValue({}); + jest.spyOn(wrapper.vm.config, 'fetchUsers').mockRejectedValue({}); getBaseToken().vm.$emit('fetch-suggestions', 'root'); @@ -153,7 +153,7 @@ describe('AuthorToken', () => { }); it('sets `loading` to false when request completes', async () => { - jest.spyOn(wrapper.vm.config, 'fetchAuthors').mockRejectedValue({}); + jest.spyOn(wrapper.vm.config, 'fetchUsers').mockRejectedValue({}); getBaseToken().vm.$emit('fetch-suggestions', 'root'); @@ -174,23 +174,23 @@ describe('AuthorToken', () => { it('renders base-token component', () => { wrapper = createComponent({ - value: { data: mockAuthors[0].username }, - data: { authors: mockAuthors }, + value: { data: mockUsers[0].username }, + data: { users: mockUsers }, }); const baseTokenEl = getBaseToken(); expect(baseTokenEl.exists()).toBe(true); expect(baseTokenEl.props()).toMatchObject({ - suggestions: mockAuthors, - getActiveTokenValue: wrapper.vm.getActiveAuthor, + suggestions: mockUsers, + getActiveTokenValue: wrapper.vm.getActiveUser, }); }); it('renders token item when value is selected', async () => { wrapper = createComponent({ - value: { data: mockAuthors[0].username }, - data: { authors: mockAuthors }, + value: { data: mockUsers[0].username }, + data: { users: mockUsers }, stubs: { Portal: true }, }); @@ -201,20 +201,20 @@ describe('AuthorToken', () => { const tokenValue = tokenSegments.at(2); - expect(tokenValue.findComponent(GlAvatar).props('src')).toBe(mockAuthors[0].avatar_url); - expect(tokenValue.text()).toBe(mockAuthors[0].name); // "Administrator" + expect(tokenValue.findComponent(GlAvatar).props('src')).toBe(mockUsers[0].avatar_url); + expect(tokenValue.text()).toBe(mockUsers[0].name); // "Administrator" }); - it('renders token value with correct avatarUrl from author object', async () => { + it('renders token value with correct avatarUrl from user object', async () => { const getAvatarEl = () => wrapper.findAllComponents(GlFilteredSearchTokenSegment).at(2).findComponent(GlAvatar); wrapper = createComponent({ - value: { data: mockAuthors[0].username }, + value: { data: mockUsers[0].username }, data: { - authors: [ + users: [ { - ...mockAuthors[0], + ...mockUsers[0], }, ], }, @@ -223,15 +223,15 @@ describe('AuthorToken', () => { await nextTick(); - expect(getAvatarEl().props('src')).toBe(mockAuthors[0].avatar_url); + expect(getAvatarEl().props('src')).toBe(mockUsers[0].avatar_url); // setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details // eslint-disable-next-line no-restricted-syntax wrapper.setData({ - authors: [ + users: [ { - ...mockAuthors[0], - avatarUrl: mockAuthors[0].avatar_url, + ...mockUsers[0], + avatarUrl: mockUsers[0].avatar_url, avatar_url: undefined, }, ], @@ -239,14 +239,14 @@ describe('AuthorToken', () => { await nextTick(); - expect(getAvatarEl().props('src')).toBe(mockAuthors[0].avatar_url); + expect(getAvatarEl().props('src')).toBe(mockUsers[0].avatar_url); }); - it('renders provided defaultAuthors as suggestions', async () => { - const defaultAuthors = DEFAULT_NONE_ANY; + it('renders provided defaultUsers as suggestions', async () => { + const defaultUsers = OPTIONS_NONE_ANY; wrapper = createComponent({ active: true, - config: { ...mockAuthorToken, defaultAuthors, preloadedAuthors: mockPreloadedAuthors }, + config: { ...mockAuthorToken, defaultUsers, preloadedUsers: mockPreloadedUsers }, stubs: { Portal: true }, }); @@ -254,16 +254,16 @@ describe('AuthorToken', () => { const suggestions = wrapper.findAllComponents(GlFilteredSearchSuggestion); - expect(suggestions).toHaveLength(defaultAuthors.length + currentUserLength); - defaultAuthors.forEach((label, index) => { + expect(suggestions).toHaveLength(defaultUsers.length + currentUserLength); + defaultUsers.forEach((label, index) => { expect(suggestions.at(index).text()).toBe(label.text); }); }); - it('does not render divider when no defaultAuthors', async () => { + it('does not render divider when no defaultUsers', async () => { wrapper = createComponent({ active: true, - config: { ...mockAuthorToken, defaultAuthors: [] }, + config: { ...mockAuthorToken, defaultUsers: [] }, stubs: { Portal: true }, }); const tokenSegments = wrapper.findAllComponents(GlFilteredSearchTokenSegment); @@ -274,10 +274,10 @@ describe('AuthorToken', () => { expect(wrapper.findComponent(GlDropdownDivider).exists()).toBe(false); }); - it('renders `DEFAULT_NONE_ANY` as default suggestions', async () => { + it('renders `OPTIONS_NONE_ANY` as default suggestions', async () => { wrapper = createComponent({ active: true, - config: { ...mockAuthorToken, preloadedAuthors: mockPreloadedAuthors }, + config: { ...mockAuthorToken, preloadedUsers: mockPreloadedUsers }, stubs: { Portal: true }, }); @@ -286,8 +286,8 @@ describe('AuthorToken', () => { const suggestions = wrapper.findAllComponents(GlFilteredSearchSuggestion); expect(suggestions).toHaveLength(2 + currentUserLength); - expect(suggestions.at(0).text()).toBe(DEFAULT_NONE_ANY[0].text); - expect(suggestions.at(1).text()).toBe(DEFAULT_NONE_ANY[1].text); + expect(suggestions.at(0).text()).toBe(OPTIONS_NONE_ANY[0].text); + expect(suggestions.at(1).text()).toBe(OPTIONS_NONE_ANY[1].text); }); it('emits listeners in the base-token', () => { @@ -308,8 +308,8 @@ describe('AuthorToken', () => { active: true, config: { ...mockAuthorToken, - preloadedAuthors: mockPreloadedAuthors, - defaultAuthors: [], + preloadedUsers: mockPreloadedUsers, + defaultUsers: [], }, stubs: { Portal: true }, }); |