Commit f3013e22 authored by Illya Klymov's avatar Illya Klymov

Deprecate setData calls in vue specs (ee)

* add lint against setData
* add eslint-ignore for existing cases
parent 6a0d815d
......@@ -213,6 +213,8 @@ describe('DevopsAdoptionTable', () => {
beforeEach(() => {
createComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
selectedNamespace: devopsAdoptionNamespaceData.nodes[0],
});
......
......@@ -128,6 +128,8 @@ describe('ThroughputChart', () => {
describe('with data', () => {
beforeEach(() => {
wrapper = createComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ throughputChartData });
});
......@@ -147,6 +149,8 @@ describe('ThroughputChart', () => {
describe('with no data in the response', () => {
beforeEach(() => {
wrapper = createComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ throughputChartData: throughputChartNoData });
});
......@@ -169,6 +173,8 @@ describe('ThroughputChart', () => {
describe('with errors', () => {
beforeEach(() => {
wrapper = createComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ hasError: true });
});
......
......@@ -64,6 +64,8 @@ describe('ThroughputTable', () => {
};
const additionalData = (data) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
throughputTableData: {
list: [{ ...throughputTableData[0], ...data }],
......@@ -147,6 +149,8 @@ describe('ThroughputTable', () => {
describe('with data', () => {
beforeEach(() => {
wrapper = createComponent({ func: mount });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
throughputTableData: {
list: throughputTableData,
......@@ -377,6 +381,8 @@ describe('ThroughputTable', () => {
describe('pagination', () => {
beforeEach(() => {
wrapper = createComponent({ func: mount });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
throughputTableData: {
list: throughputTableData,
......@@ -391,6 +397,8 @@ describe('ThroughputTable', () => {
});
it('disables the next button on the last page', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
pagination: {
currentPage: 3,
......@@ -409,6 +417,8 @@ describe('ThroughputTable', () => {
});
it('shows the prev and next buttons on middle pages', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
pagination: {
currentPage: 2,
......@@ -431,6 +441,8 @@ describe('ThroughputTable', () => {
describe('with errors', () => {
beforeEach(() => {
wrapper = createComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ hasError: true });
});
......
......@@ -59,6 +59,8 @@ describe('Download test coverage component', () => {
describe('when there is an error fetching the projects', () => {
it('displays an alert for the failed query', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ hasError: true });
return wrapper.vm.$nextTick().then(() => {
......@@ -72,6 +74,8 @@ describe('Download test coverage component', () => {
describe('with all projects selected', () => {
it('renders primary action as a link with no project_ids param', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ allProjectsSelected: true, selectedProjectIds: [] });
return wrapper.vm.$nextTick().then(() => {
......@@ -84,6 +88,8 @@ describe('Download test coverage component', () => {
describe('with two or more projects selected without selecting all projects', () => {
it('renders primary action as a link with two project IDs as parameters', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ allProjectsSelected: false, selectedProjectIds: [1, 2] });
const projectIdsQueryParam = `project_ids[]=1&project_ids[]=2`;
const expectedPath = `${groupAnalyticsCoverageReportsPathWithDates}&${projectIdsQueryParam}`;
......@@ -96,6 +102,8 @@ describe('Download test coverage component', () => {
describe('with one project selected', () => {
it('renders primary action as a link with one project ID as a parameter', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ allProjectsSelected: false, selectedProjectIds: [1] });
const projectIdsQueryParam = `project_ids[]=1`;
const expectedPath = `${groupAnalyticsCoverageReportsPathWithDates}&${projectIdsQueryParam}`;
......@@ -114,6 +122,8 @@ describe('Download test coverage component', () => {
describe('when clicking the select all button', () => {
it('selects all projects and removes the disabled attribute from the download button', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ allProjectsSelected: false, selectedProjectIds: [] });
clickSelectAllProjectsButton();
......
......@@ -51,6 +51,8 @@ describe('UrlSyncMixin', () => {
${'group_id'} | ${'test-group'} | ${{ group_id: 'test-group' }}
${'project_ids'} | ${[1, 2]} | ${{ project_ids: [1, 2] }}
`('is updated when the $param parameter changes', ({ param, payload, updatedParams }) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ [param]: payload });
expect(wrapper.vm.query).toEqual({
......
......@@ -99,6 +99,8 @@ describe('BoardsSelector', () => {
});
wrapper.vm.$apollo.addSmartQuery = jest.fn((_, options) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
[options.loadingKey]: true,
});
......@@ -166,6 +168,8 @@ describe('BoardsSelector', () => {
// Emits gl-dropdown show event to simulate the dropdown is opened at initialization time
findDropdown().vm.$emit('show');
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await wrapper.setData({
loadingBoards: false,
loadingRecentBoards: false,
......
......@@ -98,6 +98,8 @@ describe('GroupSelect component', () => {
describe('when mounted', () => {
it('displays a loading icon while descendant groups are being fetched', async () => {
createWrapper({ loading: true });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ initialLoading: true });
await wrapper.vm.$nextTick();
......
......@@ -33,6 +33,8 @@ describe('Environment Alert', () => {
describe('has alert', () => {
beforeEach(() => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
alert: {
severity: 'CRITICAL',
......
......@@ -152,6 +152,8 @@ describe('EpicsListRoot', () => {
describe('fetchEpicsBy', () => {
it('updates prevPageCursor and nextPageCursor values when provided propsName param is "currentPage"', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
epics: {
pageInfo: mockPageInfo,
......@@ -173,6 +175,8 @@ describe('EpicsListRoot', () => {
it('renders issuable-list component', async () => {
jest.spyOn(wrapper.vm, 'getFilteredSearchTokens');
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
filterParams: {
search: 'foo',
......@@ -212,6 +216,8 @@ describe('EpicsListRoot', () => {
`(
'sets showPaginationControls prop value as $returnValue when hasPreviousPage is $hasPreviousPage and hasNextPage is $hasNextPage within `epics.pageInfo`',
async ({ hasPreviousPage, hasNextPage, returnValue }) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
epics: {
pageInfo: {
......@@ -228,6 +234,8 @@ describe('EpicsListRoot', () => {
);
it('sets previousPage prop value a number representing previous page based on currentPage value', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentPage: 3,
});
......@@ -238,6 +246,8 @@ describe('EpicsListRoot', () => {
});
it('sets nextPage prop value a number representing next page based on currentPage value', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentPage: 1,
epicsCount: {
......@@ -253,6 +263,8 @@ describe('EpicsListRoot', () => {
});
it('sets nextPage prop value as `null` when currentPage is already last page', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentPage: 3,
epicsCount: {
......
......@@ -162,6 +162,8 @@ describe('EscalationRule', () => {
},
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ hasFocus: false });
});
......
......@@ -58,6 +58,8 @@ describe('GeoNodeForm', () => {
${false} | ${true} | ${true} | ${true}
`(`conditional fields`, ({ primaryNode, showCore, showSelectiveSync, showCapacities }) => {
beforeEach(() => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
nodeData: { ...wrapper.vm.nodeData, primary: primaryNode },
});
......@@ -134,6 +136,8 @@ describe('GeoNodeForm', () => {
describe('removeSyncOption', () => {
beforeEach(() => {
createComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
nodeData: { ...wrapper.vm.nodeData, selectiveSyncShards: [MOCK_SYNC_SHARDS[0].value] },
});
......
......@@ -110,6 +110,8 @@ describe('CommaSeparatedListTokenSelector', () => {
createComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
return wrapper.setData({
selectedTokens: tokens,
});
......
......@@ -132,6 +132,8 @@ describe('HandRaiseLeadButton', () => {
});
it('becomes enabled when required info is there', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ countries, states, ...formData });
await wrapper.vm.$nextTick();
......@@ -154,6 +156,8 @@ describe('HandRaiseLeadButton', () => {
${'CA'} | ${true}
${'NL'} | ${false}
`('displayed $display', async ({ state, display }) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ countries, states, country: state });
await wrapper.vm.$nextTick();
......@@ -167,6 +171,8 @@ describe('HandRaiseLeadButton', () => {
wrapper = createComponent();
trackingSpy = mockTracking(undefined, wrapper.element, jest.spyOn);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ countries, states, country: 'US', ...formData, comment: 'comment' });
});
......
......@@ -170,6 +170,8 @@ describe('Iterations report', () => {
loading: false,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
iteration,
});
......@@ -218,6 +220,8 @@ describe('Iterations report', () => {
loading: false,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
iteration,
});
......@@ -249,6 +253,8 @@ describe('Iterations report', () => {
loading: false,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
iteration,
});
......@@ -301,6 +307,8 @@ describe('Iterations report', () => {
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
iteration,
});
......
......@@ -74,6 +74,8 @@ describe('Iterations', () => {
mountComponent({
loading: false,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
namespace: {
pageInfo: {
......@@ -185,6 +187,8 @@ describe('Iterations', () => {
mountComponent({
loading: false,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
error: 'Oh no!',
});
......
......@@ -191,6 +191,8 @@ describe('On-call schedule', () => {
describe('Timeframe update', () => {
describe('WEEKS view', () => {
beforeEach(() => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ presetType: PRESET_TYPES.WEEKS });
});
......@@ -225,6 +227,8 @@ describe('On-call schedule', () => {
describe('DAYS view', () => {
beforeEach(() => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ presetType: PRESET_TYPES.DAYS });
});
it('should load next timeframe', () => {
......
......@@ -51,6 +51,8 @@ describe('RelatedItemsTree', () => {
it('returns false when either `inputValue` prop is non-empty or `isSubmitting` prop is false', () => {
const wrapperWithInput = createComponent(false);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapperWithInput.setData({
inputValue: 'foo',
});
......@@ -86,6 +88,8 @@ describe('RelatedItemsTree', () => {
it('returns group name when a group is selected', () => {
const group = { name: 'Group 1' };
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ selectedGroup: group });
expect(wrapper.vm.dropdownPlaceholderText).toBe(group.name);
});
......@@ -98,6 +102,8 @@ describe('RelatedItemsTree', () => {
${'FooBar'} | ${false}
${mockParentItem.groupName} | ${true}
`('returns `$expected` when searchTerm is $searchTerm', ({ searchTerm, expected }) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ searchTerm });
expect(wrapper.vm.canShowParentGroup).toBe(expected);
});
......
......@@ -74,6 +74,8 @@ describe('CreateIssueForm', () => {
describe('computed', () => {
describe('dropdownToggleText', () => {
it('returns project name with name_with_namespace when `selectedProject` is not empty', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
selectedProject: mockProjects[0],
});
......@@ -84,6 +86,8 @@ describe('CreateIssueForm', () => {
});
it('returns project name with namespace when `selectedProject` is not empty and dont have name_with_namespace', async () => {
const project = { ...mockProjects[0], name_with_namespace: undefined, namespace: 'foo' };
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
selectedProject: project,
});
......@@ -108,6 +112,8 @@ describe('CreateIssueForm', () => {
describe('createIssue', () => {
it('emits event `submit` on component when `selectedProject` is not empty', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
selectedProject: {
...mockProjects[0],
......@@ -227,6 +233,8 @@ describe('CreateIssueForm', () => {
wrapper.findComponent(GlDropdown).trigger('click');
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
searchKey,
});
......@@ -248,6 +256,8 @@ describe('CreateIssueForm', () => {
wrapper.findComponent(GlDropdown).trigger('click');
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
searchKey,
});
......
......@@ -432,6 +432,8 @@ describe('RelatedItemsTree', () => {
wrapper.vm.onMove(mockEvt, mockOriginalEvt);
// Simulate cursor movement.
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentClientX: 10,
currentClientY: 20,
......
......@@ -36,6 +36,8 @@ const createComponent = async (codeOwners = [codeOwnerMock]) => {
}),
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isFetching: false });
await waitForPromises();
......
......@@ -69,6 +69,8 @@ describe('LockButton component', () => {
it('passes the correct prop if lockLoading is set to true', async () => {
createComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ lockLoading: true });
await nextTick();
......
......@@ -45,6 +45,8 @@ describe('ExportRequirementsModal', () => {
it("adds field if it's not selected", async () => {
const [field] = wrapper.vm.$options.fields;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await wrapper.setData({
selectedFields: wrapper.vm.$options.fields.slice(1).map((f) => f.key),
});
......@@ -65,6 +67,8 @@ describe('ExportRequirementsModal', () => {
it('returns false when field is in selectedFields', async () => {
const [field] = wrapper.vm.$options.fields;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await wrapper.setData({
selectedFields: wrapper.vm.$options.fields.slice(1).map((f) => f.key),
});
......@@ -75,6 +79,8 @@ describe('ExportRequirementsModal', () => {
describe('toggleAllFields', () => {
it('selects all if few are selected', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await wrapper.setData({
selectedFields: wrapper.vm.$options.fields.slice(1).map((f) => f.key),
});
......@@ -91,6 +97,8 @@ describe('ExportRequirementsModal', () => {
});
it('selects all if none are selected', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await wrapper.setData({
selectedFields: [],
});
......
......@@ -28,6 +28,8 @@ describe('ImportRequirementsModal', () => {
});
it('returns false when file is present', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ file: 'Some file' });
expect(wrapper.vm.importDisabled).toBe(false);
......@@ -58,6 +60,8 @@ describe('ImportRequirementsModal', () => {
it('GlModal open click emits file and projectPath', () => {
const file = 'some file';
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
file,
});
......
......@@ -234,6 +234,8 @@ describe('RequirementForm', () => {
it(`returns ${newLastTestReportState} when \`satisfied\` has changed from ${
requirement.satisfied
} to ${!requirement.satisfied}`, () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapperWithRequirement.setData({
satisfied: !requirement.satisfied,
});
......
......@@ -165,6 +165,8 @@ describe('RequirementsRoot', () => {
});
it('returns `true` when `requirements.list` is empty', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
requirements: {
list: [],
......@@ -177,6 +179,8 @@ describe('RequirementsRoot', () => {
});
it('returns `true` when `requirementsCount` for current filterBy value is 0', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
filterBy: FilterState.opened,
requirementsCount: {
......@@ -192,6 +196,8 @@ describe('RequirementsRoot', () => {
describe('totalRequirementsForCurrentTab', () => {
it('returns number representing total requirements for current tab', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
filterBy: FilterState.opened,
requirementsCount: {
......@@ -207,6 +213,8 @@ describe('RequirementsRoot', () => {
describe('showEmptyState', () => {
it('returns `false` when `showRequirementCreateDrawer` is true', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
showRequirementCreateDrawer: true,
});
......@@ -219,6 +227,8 @@ describe('RequirementsRoot', () => {
describe('showPaginationControls', () => {
it('returns `true` when totalRequirements is more than default page size', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
requirements: {
list: mockRequirementsOpen,
......@@ -233,6 +243,8 @@ describe('RequirementsRoot', () => {
});
it('returns `false` when totalRequirements is less than default page size', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
requirements: {
list: [mockRequirementsOpen[0]],
......@@ -260,6 +272,8 @@ describe('RequirementsRoot', () => {
`(
'returns $isVisible when hasPreviousPage is $hasPreviousPage and hasNextPage is $hasNextPage within `requirements.pageInfo`',
({ hasPreviousPage, hasNextPage, isVisible }) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
requirements: {
pageInfo: {
......@@ -278,6 +292,8 @@ describe('RequirementsRoot', () => {
describe('prevPage', () => {
it('returns number representing previous page based on currentPage value', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentPage: 3,
});
......@@ -294,6 +310,8 @@ describe('RequirementsRoot', () => {
});
it('returns `null` when currentPage is already last page', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentPage: 2,
});
......@@ -328,6 +346,8 @@ describe('RequirementsRoot', () => {
describe('getFilteredSearchValue', () => {
it('returns array containing applied filter search values', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
authorUsernames: ['root', 'john.doe'],
status: 'satisfied',
......@@ -342,6 +362,8 @@ describe('RequirementsRoot', () => {
describe('updateUrl', () => {
it('updates window URL based on presence of props for filtered search and sort criteria', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
filterBy: FilterState.all,
currentPage: 2,
......@@ -713,6 +735,8 @@ describe('RequirementsRoot', () => {
describe('handleNewRequirementCancel', () => {
it('sets `showRequirementCreateDrawer` prop to `false`', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
showRequirementCreateDrawer: true,
});
......@@ -861,6 +885,8 @@ describe('RequirementsRoot', () => {
});
it('updates props `textSearch` and `authorUsernames` with empty values when passed filters param is empty', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
authorUsernames: ['root'],
status: 'satisfied',
......@@ -892,6 +918,8 @@ describe('RequirementsRoot', () => {
describe('handlePageChange', () => {
it('sets data prop `prevPageCursor` to empty string and `nextPageCursor` to `requirements.pageInfo.endCursor` when provided page param is greater than currentPage', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
requirements: {
list: mockRequirementsOpen,
......@@ -917,6 +945,8 @@ describe('RequirementsRoot', () => {
});
it('sets data prop `nextPageCursor` to empty string and `prevPageCursor` to `requirements.pageInfo.startCursor` when provided page param is less than currentPage', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
requirements: {
list: mockRequirementsOpen,
......@@ -967,6 +997,8 @@ describe('RequirementsRoot', () => {
});
it('renders empty state when query results are empty', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
requirements: {
list: [],
......@@ -998,6 +1030,8 @@ describe('RequirementsRoot', () => {
});
it('does not render requirement-empty-state component when `showRequirementCreateDrawer` prop is `true`', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
showRequirementCreateDrawer: true,
});
......@@ -1008,6 +1042,8 @@ describe('RequirementsRoot', () => {
});
it('renders requirement items for all the requirements', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
requirements: {
list: mockRequirementsOpen,
......@@ -1025,6 +1061,8 @@ describe('RequirementsRoot', () => {
});
it('renders pagination controls', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
requirements: {
list: mockRequirementsOpen,
......
......@@ -55,6 +55,8 @@ describe('CurrentDayIndicator', () => {
describe('computed', () => {
describe('hasToday', () => {
it('returns true when presetType is QUARTERS and currentDate is within current quarter', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentDate: mockTimeframeQuarters[0].range[1],
});
......@@ -70,6 +72,8 @@ describe('CurrentDayIndicator', () => {
});
it('returns true when presetType is MONTHS and currentDate is within current month', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentDate: new Date(2020, 0, 15),
});
......@@ -85,6 +89,8 @@ describe('CurrentDayIndicator', () => {
});
it('returns true when presetType is WEEKS and currentDate is within current week', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentDate: mockTimeframeWeeks[0],
});
......@@ -104,6 +110,8 @@ describe('CurrentDayIndicator', () => {
describe('methods', () => {
describe('getIndicatorStyles', () => {
it('returns object containing `left` with value `34%` when presetType is QUARTERS', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentDate: mockTimeframeQuarters[0].range[1],
});
......@@ -123,6 +131,8 @@ describe('CurrentDayIndicator', () => {
});
it('returns object containing `left` with value `48%` when presetType is MONTHS', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentDate: new Date(2020, 0, 15),
});
......@@ -142,6 +152,8 @@ describe('CurrentDayIndicator', () => {
});
it('returns object containing `left` with value `7%` when presetType is WEEKS', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentDate: mockTimeframeWeeks[0],
});
......@@ -165,6 +177,8 @@ describe('CurrentDayIndicator', () => {
describe('template', () => {
beforeEach(() => {
wrapper = createComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentDate: mockTimeframeMonths[0],
});
......
......@@ -287,6 +287,8 @@ describe('EpicsListSectionComponent', () => {
});
it('renders bottom shadow element when `showBottomShadow` prop is true', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
showBottomShadow: true,
});
......
......@@ -167,6 +167,8 @@ describe('MilestonesListSectionComponent', () => {
});
it('renders bottom shadow element when `showBottomShadow` prop is true', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
showBottomShadow: true,
});
......
......@@ -131,6 +131,8 @@ describe('RoadmapFilters', () => {
});
it('switching layout using roadmap layout switching buttons causes page to reload with selected layout', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ selectedDaterange: DATE_RANGES.THREE_YEARS });
await wrapper.vm.$nextTick();
......@@ -341,6 +343,8 @@ describe('RoadmapFilters', () => {
});
it('renders daterange dropdown', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapperWithDaterangeFilter.setData({ selectedDaterange: DATE_RANGES.CURRENT_QUARTER });
await wrapperWithDaterangeFilter.vm.$nextTick();
......@@ -362,6 +366,8 @@ describe('RoadmapFilters', () => {
`(
'renders $availablePresets.length items when selected daterange is "$selectedDaterange"',
async ({ selectedDaterange, availablePresets }) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapperWithDaterangeFilter.setData({ selectedDaterange });
await wrapperWithDaterangeFilter.vm.$nextTick();
......
......@@ -191,6 +191,8 @@ describe('EE - DastProfiles', () => {
async ({ profileType, key, givenData, expectedValue, exposedAsProp }) => {
const propGetter = exposedAsProp ? 'props' : 'attributes';
createComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
profileTypes: { [profileType]: givenData },
});
......
......@@ -89,6 +89,8 @@ describe('Group Security Dashboard component', () => {
it('renders the default page', async () => {
createWrapper();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ projects: [{ name: 'project1' }] });
await wrapper.vm.$nextTick();
......
......@@ -71,6 +71,8 @@ describe('Group Security Dashboard Vulnerabilities Component', () => {
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
errorLoadingVulnerabilities: true,
});
......@@ -105,6 +107,8 @@ describe('Group Security Dashboard Vulnerabilities Component', () => {
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
vulnerabilities,
});
......@@ -151,6 +155,8 @@ describe('Group Security Dashboard Vulnerabilities Component', () => {
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
vulnerabilities,
pageInfo: {
......@@ -172,6 +178,8 @@ describe('Group Security Dashboard Vulnerabilities Component', () => {
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
vulnerabilities: generateVulnerabilities(),
pageInfo: {
......
......@@ -92,6 +92,8 @@ describe('Instance Security Dashboard component', () => {
it('renders the default page', async () => {
createWrapper();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ projects: [{ name: 'project1' }] });
await wrapper.vm.$nextTick();
......
......@@ -145,6 +145,8 @@ describe('Security reports summary component', () => {
});
it('set local storage item to 1 when summary is hidden', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isVisible: false });
await wrapper.vm.$nextTick();
......@@ -163,6 +165,8 @@ describe('Security reports summary component', () => {
});
it('removes local storage item when summary is shown', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isVisible: true });
await wrapper.vm.$nextTick();
......
......@@ -90,6 +90,8 @@ describe('Vulnerabilities app component', () => {
createWrapper();
vulnerabilities = generateVulnerabilities();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ vulnerabilities });
});
......@@ -135,6 +137,8 @@ describe('Vulnerabilities app component', () => {
createWrapper();
vulnerabilities = generateVulnerabilities();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
vulnerabilities,
pageInfo: {
......@@ -155,6 +159,8 @@ describe('Vulnerabilities app component', () => {
describe(`when there's an error loading vulnerabilities`, () => {
beforeEach(() => {
createWrapper();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ errorLoadingVulnerabilities: true });
});
......
......@@ -115,6 +115,8 @@ describe('Csv Button Export', () => {
loading: false,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isPreparingCsvExport: true });
await wrapper.vm.$nextTick();
......
......@@ -112,6 +112,8 @@ describe('Scanner Filter component', () => {
};
const selectedOptions = sampleSize(filter.options, 3); // Randomly select some options.
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await wrapper.setData({ selectedOptions });
expectSelectedItems(selectedOptions);
......
......@@ -58,6 +58,8 @@ describe('Vulnerabilities count list component', () => {
describe('when counts are loaded', () => {
beforeEach(() => {
wrapper = createWrapper({ query: { loading: false } });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
vulnerabilitiesCount: {
critical: 5,
......
......@@ -254,6 +254,8 @@ describe('Status', () => {
mountStatus(props);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isDropdownShowing: true });
});
......@@ -292,6 +294,8 @@ describe('Status', () => {
mountStatus(props);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isDropdownShowing: true });
});
......
......@@ -179,6 +179,8 @@ describe('TestCaseCreateRoot', () => {
});
it('submit button shows loading animation when `createTestCaseRequestActive` is true', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
createTestCaseRequestActive: true,
});
......@@ -189,6 +191,8 @@ describe('TestCaseCreateRoot', () => {
});
it('cancel button is disabled when `createTestCaseRequestActive` is true', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
createTestCaseRequestActive: true,
});
......
......@@ -166,6 +166,8 @@ describe('TestCaseListRoot', () => {
});
it('returns number representing next page based on currentPage value', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentPage: 1,
});
......@@ -176,6 +178,8 @@ describe('TestCaseListRoot', () => {
});
it('returns `null` when currentPage is already last page', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
currentPage: 3,
});
......@@ -229,6 +233,8 @@ describe('TestCaseListRoot', () => {
});
it('page-change event changes prevPageCursor and nextPageCursor values based on based on currentPage and calls updateUrl', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await wrapper.setData({
testCases: {
pageInfo: mockPageInfo,
......
......@@ -85,6 +85,8 @@ describe('TestCaseShowRoot', () => {
testCaseActionTitle,
}) => {
beforeEach(async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
testCase: {
...mockTestCase,
......@@ -235,6 +237,8 @@ describe('TestCaseShowRoot', () => {
describe('handleCancelClick', () => {
it('sets `editTestCaseFormVisible` prop to false and emits "close.form" even in IssuableEventHub', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
editTestCaseFormVisible: true,
});
......@@ -264,6 +268,8 @@ describe('TestCaseShowRoot', () => {
describe('template', () => {
it('renders gl-loading-icon when testCaseLoading prop is true', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
testCaseLoading: true,
});
......@@ -319,6 +325,8 @@ describe('TestCaseShowRoot', () => {
});
it('does not render issuable-show when `testCaseLoading` prop is false and `testCaseLoadFailed` prop is true', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
testCaseLoading: false,
testCaseLoadFailed: true,
......@@ -361,6 +369,8 @@ describe('TestCaseShowRoot', () => {
});
it('renders edit-form-actions slot contents', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
editTestCaseFormVisible: true,
});
......
......@@ -86,6 +86,8 @@ describe('TestCaseSidebar', () => {
`(
'returns $returnValue when testCaseMoveInProgress is $testCaseMoveInProgress',
async ({ testCaseMoveInProgress, returnValue }) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
testCaseMoveInProgress,
});
......@@ -197,6 +199,8 @@ describe('TestCaseSidebar', () => {
describe('handleSidebarDropdownClose', () => {
it('sets `sidebarExpandedOnClick` to false and calls `toggleSidebar` method when `sidebarExpandedOnClick` is true', async () => {
jest.spyOn(wrapper.vm, 'toggleSidebar').mockImplementation(jest.fn());
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
sidebarExpandedOnClick: true,
});
......
......@@ -262,6 +262,8 @@ describe('AlertsList component', () => {
});
it('does not show the unconfigured alert error state when there is a request error', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
errored: true,
});
......@@ -271,6 +273,8 @@ describe('AlertsList component', () => {
});
it('does not show the unconfigured alert error state when there is a request error that has been dismissed', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
isErrorAlertDismissed: true,
});
......
......@@ -73,6 +73,8 @@ describe('NamespaceStorageApp', () => {
});
it('renders the 2 projects', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
namespace: namespaceData,
});
......@@ -84,6 +86,8 @@ describe('NamespaceStorageApp', () => {
describe('limit', () => {
it('when limit is set it renders limit information', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
namespace: namespaceData,
});
......@@ -94,6 +98,8 @@ describe('NamespaceStorageApp', () => {
});
it('when limit is 0 it does not render limit information', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
namespace: { ...namespaceData, limit: 0 },
});
......@@ -106,6 +112,8 @@ describe('NamespaceStorageApp', () => {
describe('with rootStorageStatistics information', () => {
it('renders total usage', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
namespace: withRootStorageStatistics,
});
......@@ -118,6 +126,8 @@ describe('NamespaceStorageApp', () => {
describe('with additional_repo_storage_by_namespace feature', () => {
it('usage_graph component hidden is when feature is false', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
namespace: withRootStorageStatistics,
});
......@@ -145,6 +155,8 @@ describe('NamespaceStorageApp', () => {
describe('without rootStorageStatistics information', () => {
it('renders N/A', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
namespace: namespaceData,
});
......@@ -195,6 +207,8 @@ describe('NamespaceStorageApp', () => {
describe('when temporary storage increase is visible', () => {
beforeEach(() => {
createComponent({ provide: { isTemporaryStorageIncreaseVisible: 'true' } });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({
namespace: {
...namespaceData,
......
......@@ -107,6 +107,8 @@ describe('ReadyToMerge', () => {
it('should return "Merge in progress"', () => {
factory();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isMergingImmediately: true });
expect(vm.mergeButtonText).toEqual('Merge in progress');
......
......@@ -141,6 +141,8 @@ describe('AccordionItem component', () => {
});
it('collapses if "closeOtherAccordionItems" is called with the trigger not being the current item', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isExpanded: true });
wrapper.vm.onCloseOtherAccordionItems({});
......@@ -148,6 +150,8 @@ describe('AccordionItem component', () => {
});
it('does not collapses if "closeOtherAccordionItems" is called with the trigger being the current item', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isExpanded: true });
wrapper.vm.onCloseOtherAccordionItems(wrapper.vm);
......@@ -177,6 +181,8 @@ describe('AccordionItem component', () => {
it('has a trigger element that has an "aria-expanded" attribute set, to show if it is expanded or collapsed', () => {
expect(expansionTrigger().attributes('aria-expanded')).toBeFalsy();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isExpanded: true });
return wrapper.vm.$nextTick().then(() => {
......
......@@ -55,6 +55,8 @@ describe('IterationToken', () => {
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await wrapper.setData({ loading: false });
});
......
......@@ -34,6 +34,8 @@ describe('AddLicenseForm', () => {
createComponent({}, mount);
jest.spyOn(vm, '$emit').mockImplementation(() => {});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ approvalStatus: LICENSE_APPROVAL_STATUS.ALLOWED, licenseName: name });
await Vue.nextTick();
......@@ -60,12 +62,16 @@ describe('AddLicenseForm', () => {
describe('computed', () => {
describe('submitDisabled', () => {
it('is true if the approvalStatus is empty', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ licenseName: 'FOO', approvalStatus: '' });
expect(vm.submitDisabled).toBe(true);
});
it('is true if the licenseName is empty', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ licenseName: '', approvalStatus: LICENSE_APPROVAL_STATUS.ALLOWED });
expect(vm.submitDisabled).toBe(true);
......@@ -73,6 +79,8 @@ describe('AddLicenseForm', () => {
it('is true if the entered license is duplicated', () => {
createComponent({ managedLicenses: [{ name: 'FOO' }] });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ licenseName: 'FOO', approvalStatus: LICENSE_APPROVAL_STATUS.ALLOWED });
expect(vm.submitDisabled).toBe(true);
......@@ -82,6 +90,8 @@ describe('AddLicenseForm', () => {
describe('isInvalidLicense', () => {
it('is true if the entered license is duplicated', () => {
createComponent({ managedLicenses: [{ name: 'FOO' }] });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ licenseName: 'FOO' });
expect(vm.isInvalidLicense).toBe(true);
......@@ -89,6 +99,8 @@ describe('AddLicenseForm', () => {
it('is false if the entered license is unique', () => {
createComponent({ managedLicenses: [{ name: 'FOO' }] });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ licenseName: 'FOO2' });
expect(vm.isInvalidLicense).toBe(false);
......@@ -126,6 +138,8 @@ describe('AddLicenseForm', () => {
it('renders error text, if there is a duplicate license', async () => {
createComponent({ managedLicenses: [{ name: 'FOO' }] });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ licenseName: 'FOO' });
await Vue.nextTick();
......@@ -156,6 +170,8 @@ describe('AddLicenseForm', () => {
});
it('disables submit, if the form is invalid', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ licenseName: '' });
await Vue.nextTick();
......
......@@ -54,6 +54,8 @@ describe('New vulnerability - Section Name', () => {
${'Name'} | ${GlFormInput} | ${{ vulnerabilityName: 'CVE 2021', vulnerabilityDesc: '' }}
${'Description'} | ${GlFormTextarea} | ${{ vulnerabilityName: '', vulnerabilityDesc: 'Password leak' }}
`('emits the changes: $field ', async ({ component, value }) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData(value);
wrapper.findComponent(component).vm.$emit('change', value);
expect(wrapper.emitted('change')[0][0]).toEqual(value);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment