Commit 2495cecb authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents fa61df4a 39c9ceef
...@@ -99,6 +99,10 @@ overrides: ...@@ -99,6 +99,10 @@ overrides:
rules: rules:
'@gitlab/require-i18n-strings': off '@gitlab/require-i18n-strings': off
'@gitlab/no-runtime-template-compiler': off '@gitlab/no-runtime-template-compiler': off
'no-restricted-syntax':
- error
- selector: CallExpression[callee.object.name=/(wrapper|vm)/][callee.property.name="setData"]
message: 'Avoid using "setData" on VTU wrapper'
- files: - files:
- 'config/**/*' - 'config/**/*'
- 'scripts/**/*' - 'scripts/**/*'
......
...@@ -213,6 +213,8 @@ describe('DevopsAdoptionTable', () => { ...@@ -213,6 +213,8 @@ describe('DevopsAdoptionTable', () => {
beforeEach(() => { beforeEach(() => {
createComponent(); 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({ wrapper.setData({
selectedNamespace: devopsAdoptionNamespaceData.nodes[0], selectedNamespace: devopsAdoptionNamespaceData.nodes[0],
}); });
......
...@@ -128,6 +128,8 @@ describe('ThroughputChart', () => { ...@@ -128,6 +128,8 @@ describe('ThroughputChart', () => {
describe('with data', () => { describe('with data', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createComponent(); 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 }); wrapper.setData({ throughputChartData });
}); });
...@@ -147,6 +149,8 @@ describe('ThroughputChart', () => { ...@@ -147,6 +149,8 @@ describe('ThroughputChart', () => {
describe('with no data in the response', () => { describe('with no data in the response', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createComponent(); 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 }); wrapper.setData({ throughputChartData: throughputChartNoData });
}); });
...@@ -169,6 +173,8 @@ describe('ThroughputChart', () => { ...@@ -169,6 +173,8 @@ describe('ThroughputChart', () => {
describe('with errors', () => { describe('with errors', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createComponent(); 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 }); wrapper.setData({ hasError: true });
}); });
......
...@@ -64,6 +64,8 @@ describe('ThroughputTable', () => { ...@@ -64,6 +64,8 @@ describe('ThroughputTable', () => {
}; };
const additionalData = (data) => { 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({ wrapper.setData({
throughputTableData: { throughputTableData: {
list: [{ ...throughputTableData[0], ...data }], list: [{ ...throughputTableData[0], ...data }],
...@@ -147,6 +149,8 @@ describe('ThroughputTable', () => { ...@@ -147,6 +149,8 @@ describe('ThroughputTable', () => {
describe('with data', () => { describe('with data', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createComponent({ func: mount }); 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({ wrapper.setData({
throughputTableData: { throughputTableData: {
list: throughputTableData, list: throughputTableData,
...@@ -377,6 +381,8 @@ describe('ThroughputTable', () => { ...@@ -377,6 +381,8 @@ describe('ThroughputTable', () => {
describe('pagination', () => { describe('pagination', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createComponent({ func: mount }); 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({ wrapper.setData({
throughputTableData: { throughputTableData: {
list: throughputTableData, list: throughputTableData,
...@@ -391,6 +397,8 @@ describe('ThroughputTable', () => { ...@@ -391,6 +397,8 @@ describe('ThroughputTable', () => {
}); });
it('disables the next button on the last page', async () => { 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({ wrapper.setData({
pagination: { pagination: {
currentPage: 3, currentPage: 3,
...@@ -409,6 +417,8 @@ describe('ThroughputTable', () => { ...@@ -409,6 +417,8 @@ describe('ThroughputTable', () => {
}); });
it('shows the prev and next buttons on middle pages', async () => { 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({ wrapper.setData({
pagination: { pagination: {
currentPage: 2, currentPage: 2,
...@@ -431,6 +441,8 @@ describe('ThroughputTable', () => { ...@@ -431,6 +441,8 @@ describe('ThroughputTable', () => {
describe('with errors', () => { describe('with errors', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createComponent(); 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 }); wrapper.setData({ hasError: true });
}); });
......
...@@ -59,6 +59,8 @@ describe('Download test coverage component', () => { ...@@ -59,6 +59,8 @@ describe('Download test coverage component', () => {
describe('when there is an error fetching the projects', () => { describe('when there is an error fetching the projects', () => {
it('displays an alert for the failed query', () => { 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 }); wrapper.setData({ hasError: true });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
...@@ -72,6 +74,8 @@ describe('Download test coverage component', () => { ...@@ -72,6 +74,8 @@ describe('Download test coverage component', () => {
describe('with all projects selected', () => { describe('with all projects selected', () => {
it('renders primary action as a link with no project_ids param', () => { 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: [] }); wrapper.setData({ allProjectsSelected: true, selectedProjectIds: [] });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
...@@ -84,6 +88,8 @@ describe('Download test coverage component', () => { ...@@ -84,6 +88,8 @@ describe('Download test coverage component', () => {
describe('with two or more projects selected without selecting all projects', () => { describe('with two or more projects selected without selecting all projects', () => {
it('renders primary action as a link with two project IDs as parameters', () => { 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] }); wrapper.setData({ allProjectsSelected: false, selectedProjectIds: [1, 2] });
const projectIdsQueryParam = `project_ids[]=1&project_ids[]=2`; const projectIdsQueryParam = `project_ids[]=1&project_ids[]=2`;
const expectedPath = `${groupAnalyticsCoverageReportsPathWithDates}&${projectIdsQueryParam}`; const expectedPath = `${groupAnalyticsCoverageReportsPathWithDates}&${projectIdsQueryParam}`;
...@@ -96,6 +102,8 @@ describe('Download test coverage component', () => { ...@@ -96,6 +102,8 @@ describe('Download test coverage component', () => {
describe('with one project selected', () => { describe('with one project selected', () => {
it('renders primary action as a link with one project ID as a parameter', () => { 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] }); wrapper.setData({ allProjectsSelected: false, selectedProjectIds: [1] });
const projectIdsQueryParam = `project_ids[]=1`; const projectIdsQueryParam = `project_ids[]=1`;
const expectedPath = `${groupAnalyticsCoverageReportsPathWithDates}&${projectIdsQueryParam}`; const expectedPath = `${groupAnalyticsCoverageReportsPathWithDates}&${projectIdsQueryParam}`;
...@@ -114,6 +122,8 @@ describe('Download test coverage component', () => { ...@@ -114,6 +122,8 @@ describe('Download test coverage component', () => {
describe('when clicking the select all button', () => { describe('when clicking the select all button', () => {
it('selects all projects and removes the disabled attribute from the download 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: [] }); wrapper.setData({ allProjectsSelected: false, selectedProjectIds: [] });
clickSelectAllProjectsButton(); clickSelectAllProjectsButton();
......
...@@ -51,6 +51,8 @@ describe('UrlSyncMixin', () => { ...@@ -51,6 +51,8 @@ describe('UrlSyncMixin', () => {
${'group_id'} | ${'test-group'} | ${{ group_id: 'test-group' }} ${'group_id'} | ${'test-group'} | ${{ group_id: 'test-group' }}
${'project_ids'} | ${[1, 2]} | ${{ project_ids: [1, 2] }} ${'project_ids'} | ${[1, 2]} | ${{ project_ids: [1, 2] }}
`('is updated when the $param parameter changes', ({ param, payload, updatedParams }) => { `('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 }); wrapper.setData({ [param]: payload });
expect(wrapper.vm.query).toEqual({ expect(wrapper.vm.query).toEqual({
......
...@@ -99,6 +99,8 @@ describe('BoardsSelector', () => { ...@@ -99,6 +99,8 @@ describe('BoardsSelector', () => {
}); });
wrapper.vm.$apollo.addSmartQuery = jest.fn((_, options) => { 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({ wrapper.setData({
[options.loadingKey]: true, [options.loadingKey]: true,
}); });
...@@ -166,6 +168,8 @@ describe('BoardsSelector', () => { ...@@ -166,6 +168,8 @@ describe('BoardsSelector', () => {
// Emits gl-dropdown show event to simulate the dropdown is opened at initialization time // Emits gl-dropdown show event to simulate the dropdown is opened at initialization time
findDropdown().vm.$emit('show'); 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({ await wrapper.setData({
loadingBoards: false, loadingBoards: false,
loadingRecentBoards: false, loadingRecentBoards: false,
......
...@@ -98,6 +98,8 @@ describe('GroupSelect component', () => { ...@@ -98,6 +98,8 @@ describe('GroupSelect component', () => {
describe('when mounted', () => { describe('when mounted', () => {
it('displays a loading icon while descendant groups are being fetched', async () => { it('displays a loading icon while descendant groups are being fetched', async () => {
createWrapper({ loading: true }); 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 }); wrapper.setData({ initialLoading: true });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
......
...@@ -33,6 +33,8 @@ describe('Environment Alert', () => { ...@@ -33,6 +33,8 @@ describe('Environment Alert', () => {
describe('has alert', () => { describe('has alert', () => {
beforeEach(() => { 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({ wrapper.setData({
alert: { alert: {
severity: 'CRITICAL', severity: 'CRITICAL',
......
...@@ -152,6 +152,8 @@ describe('EpicsListRoot', () => { ...@@ -152,6 +152,8 @@ describe('EpicsListRoot', () => {
describe('fetchEpicsBy', () => { describe('fetchEpicsBy', () => {
it('updates prevPageCursor and nextPageCursor values when provided propsName param is "currentPage"', async () => { 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({ wrapper.setData({
epics: { epics: {
pageInfo: mockPageInfo, pageInfo: mockPageInfo,
...@@ -173,6 +175,8 @@ describe('EpicsListRoot', () => { ...@@ -173,6 +175,8 @@ describe('EpicsListRoot', () => {
it('renders issuable-list component', async () => { it('renders issuable-list component', async () => {
jest.spyOn(wrapper.vm, 'getFilteredSearchTokens'); 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({ wrapper.setData({
filterParams: { filterParams: {
search: 'foo', search: 'foo',
...@@ -212,6 +216,8 @@ describe('EpicsListRoot', () => { ...@@ -212,6 +216,8 @@ describe('EpicsListRoot', () => {
`( `(
'sets showPaginationControls prop value as $returnValue when hasPreviousPage is $hasPreviousPage and hasNextPage is $hasNextPage within `epics.pageInfo`', 'sets showPaginationControls prop value as $returnValue when hasPreviousPage is $hasPreviousPage and hasNextPage is $hasNextPage within `epics.pageInfo`',
async ({ hasPreviousPage, hasNextPage, returnValue }) => { 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({ wrapper.setData({
epics: { epics: {
pageInfo: { pageInfo: {
...@@ -228,6 +234,8 @@ describe('EpicsListRoot', () => { ...@@ -228,6 +234,8 @@ describe('EpicsListRoot', () => {
); );
it('sets previousPage prop value a number representing previous page based on currentPage value', async () => { 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({ wrapper.setData({
currentPage: 3, currentPage: 3,
}); });
...@@ -238,6 +246,8 @@ describe('EpicsListRoot', () => { ...@@ -238,6 +246,8 @@ describe('EpicsListRoot', () => {
}); });
it('sets nextPage prop value a number representing next page based on currentPage value', async () => { 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({ wrapper.setData({
currentPage: 1, currentPage: 1,
epicsCount: { epicsCount: {
...@@ -253,6 +263,8 @@ describe('EpicsListRoot', () => { ...@@ -253,6 +263,8 @@ describe('EpicsListRoot', () => {
}); });
it('sets nextPage prop value as `null` when currentPage is already last page', async () => { 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({ wrapper.setData({
currentPage: 3, currentPage: 3,
epicsCount: { epicsCount: {
......
...@@ -162,6 +162,8 @@ describe('EscalationRule', () => { ...@@ -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 }); wrapper.setData({ hasFocus: false });
}); });
......
...@@ -58,6 +58,8 @@ describe('GeoNodeForm', () => { ...@@ -58,6 +58,8 @@ describe('GeoNodeForm', () => {
${false} | ${true} | ${true} | ${true} ${false} | ${true} | ${true} | ${true}
`(`conditional fields`, ({ primaryNode, showCore, showSelectiveSync, showCapacities }) => { `(`conditional fields`, ({ primaryNode, showCore, showSelectiveSync, showCapacities }) => {
beforeEach(() => { 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({ wrapper.setData({
nodeData: { ...wrapper.vm.nodeData, primary: primaryNode }, nodeData: { ...wrapper.vm.nodeData, primary: primaryNode },
}); });
...@@ -134,6 +136,8 @@ describe('GeoNodeForm', () => { ...@@ -134,6 +136,8 @@ describe('GeoNodeForm', () => {
describe('removeSyncOption', () => { describe('removeSyncOption', () => {
beforeEach(() => { beforeEach(() => {
createComponent(); 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({ wrapper.setData({
nodeData: { ...wrapper.vm.nodeData, selectiveSyncShards: [MOCK_SYNC_SHARDS[0].value] }, nodeData: { ...wrapper.vm.nodeData, selectiveSyncShards: [MOCK_SYNC_SHARDS[0].value] },
}); });
......
...@@ -110,6 +110,8 @@ describe('CommaSeparatedListTokenSelector', () => { ...@@ -110,6 +110,8 @@ describe('CommaSeparatedListTokenSelector', () => {
createComponent(); 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({ return wrapper.setData({
selectedTokens: tokens, selectedTokens: tokens,
}); });
......
...@@ -132,6 +132,8 @@ describe('HandRaiseLeadButton', () => { ...@@ -132,6 +132,8 @@ describe('HandRaiseLeadButton', () => {
}); });
it('becomes enabled when required info is there', async () => { 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 }); wrapper.setData({ countries, states, ...formData });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
...@@ -154,6 +156,8 @@ describe('HandRaiseLeadButton', () => { ...@@ -154,6 +156,8 @@ describe('HandRaiseLeadButton', () => {
${'CA'} | ${true} ${'CA'} | ${true}
${'NL'} | ${false} ${'NL'} | ${false}
`('displayed $display', async ({ state, display }) => { `('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 }); wrapper.setData({ countries, states, country: state });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
...@@ -167,6 +171,8 @@ describe('HandRaiseLeadButton', () => { ...@@ -167,6 +171,8 @@ describe('HandRaiseLeadButton', () => {
wrapper = createComponent(); wrapper = createComponent();
trackingSpy = mockTracking(undefined, wrapper.element, jest.spyOn); 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' }); wrapper.setData({ countries, states, country: 'US', ...formData, comment: 'comment' });
}); });
......
...@@ -170,6 +170,8 @@ describe('Iterations report', () => { ...@@ -170,6 +170,8 @@ describe('Iterations report', () => {
loading: false, 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({ wrapper.setData({
iteration, iteration,
}); });
...@@ -218,6 +220,8 @@ describe('Iterations report', () => { ...@@ -218,6 +220,8 @@ describe('Iterations report', () => {
loading: false, 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({ wrapper.setData({
iteration, iteration,
}); });
...@@ -249,6 +253,8 @@ describe('Iterations report', () => { ...@@ -249,6 +253,8 @@ describe('Iterations report', () => {
loading: false, 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({ wrapper.setData({
iteration, iteration,
}); });
...@@ -301,6 +307,8 @@ describe('Iterations report', () => { ...@@ -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({ wrapper.setData({
iteration, iteration,
}); });
......
...@@ -74,6 +74,8 @@ describe('Iterations', () => { ...@@ -74,6 +74,8 @@ describe('Iterations', () => {
mountComponent({ mountComponent({
loading: false, 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({ wrapper.setData({
namespace: { namespace: {
pageInfo: { pageInfo: {
...@@ -185,6 +187,8 @@ describe('Iterations', () => { ...@@ -185,6 +187,8 @@ describe('Iterations', () => {
mountComponent({ mountComponent({
loading: false, 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({ wrapper.setData({
error: 'Oh no!', error: 'Oh no!',
}); });
......
...@@ -191,6 +191,8 @@ describe('On-call schedule', () => { ...@@ -191,6 +191,8 @@ describe('On-call schedule', () => {
describe('Timeframe update', () => { describe('Timeframe update', () => {
describe('WEEKS view', () => { describe('WEEKS view', () => {
beforeEach(() => { 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 }); wrapper.setData({ presetType: PRESET_TYPES.WEEKS });
}); });
...@@ -225,6 +227,8 @@ describe('On-call schedule', () => { ...@@ -225,6 +227,8 @@ describe('On-call schedule', () => {
describe('DAYS view', () => { describe('DAYS view', () => {
beforeEach(() => { 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 }); wrapper.setData({ presetType: PRESET_TYPES.DAYS });
}); });
it('should load next timeframe', () => { it('should load next timeframe', () => {
......
...@@ -51,6 +51,8 @@ describe('RelatedItemsTree', () => { ...@@ -51,6 +51,8 @@ describe('RelatedItemsTree', () => {
it('returns false when either `inputValue` prop is non-empty or `isSubmitting` prop is false', () => { it('returns false when either `inputValue` prop is non-empty or `isSubmitting` prop is false', () => {
const wrapperWithInput = createComponent(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({ wrapperWithInput.setData({
inputValue: 'foo', inputValue: 'foo',
}); });
...@@ -86,6 +88,8 @@ describe('RelatedItemsTree', () => { ...@@ -86,6 +88,8 @@ describe('RelatedItemsTree', () => {
it('returns group name when a group is selected', () => { it('returns group name when a group is selected', () => {
const group = { name: 'Group 1' }; 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 }); wrapper.setData({ selectedGroup: group });
expect(wrapper.vm.dropdownPlaceholderText).toBe(group.name); expect(wrapper.vm.dropdownPlaceholderText).toBe(group.name);
}); });
...@@ -98,6 +102,8 @@ describe('RelatedItemsTree', () => { ...@@ -98,6 +102,8 @@ describe('RelatedItemsTree', () => {
${'FooBar'} | ${false} ${'FooBar'} | ${false}
${mockParentItem.groupName} | ${true} ${mockParentItem.groupName} | ${true}
`('returns `$expected` when searchTerm is $searchTerm', ({ searchTerm, expected }) => { `('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 }); wrapper.setData({ searchTerm });
expect(wrapper.vm.canShowParentGroup).toBe(expected); expect(wrapper.vm.canShowParentGroup).toBe(expected);
}); });
......
...@@ -74,6 +74,8 @@ describe('CreateIssueForm', () => { ...@@ -74,6 +74,8 @@ describe('CreateIssueForm', () => {
describe('computed', () => { describe('computed', () => {
describe('dropdownToggleText', () => { describe('dropdownToggleText', () => {
it('returns project name with name_with_namespace when `selectedProject` is not empty', () => { 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({ wrapper.setData({
selectedProject: mockProjects[0], selectedProject: mockProjects[0],
}); });
...@@ -84,6 +86,8 @@ describe('CreateIssueForm', () => { ...@@ -84,6 +86,8 @@ describe('CreateIssueForm', () => {
}); });
it('returns project name with namespace when `selectedProject` is not empty and dont have name_with_namespace', async () => { 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' }; 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({ wrapper.setData({
selectedProject: project, selectedProject: project,
}); });
...@@ -108,6 +112,8 @@ describe('CreateIssueForm', () => { ...@@ -108,6 +112,8 @@ describe('CreateIssueForm', () => {
describe('createIssue', () => { describe('createIssue', () => {
it('emits event `submit` on component when `selectedProject` is not empty', () => { 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({ wrapper.setData({
selectedProject: { selectedProject: {
...mockProjects[0], ...mockProjects[0],
...@@ -227,6 +233,8 @@ describe('CreateIssueForm', () => { ...@@ -227,6 +233,8 @@ describe('CreateIssueForm', () => {
wrapper.findComponent(GlDropdown).trigger('click'); 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({ wrapper.setData({
searchKey, searchKey,
}); });
...@@ -248,6 +256,8 @@ describe('CreateIssueForm', () => { ...@@ -248,6 +256,8 @@ describe('CreateIssueForm', () => {
wrapper.findComponent(GlDropdown).trigger('click'); 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({ wrapper.setData({
searchKey, searchKey,
}); });
......
...@@ -432,6 +432,8 @@ describe('RelatedItemsTree', () => { ...@@ -432,6 +432,8 @@ describe('RelatedItemsTree', () => {
wrapper.vm.onMove(mockEvt, mockOriginalEvt); wrapper.vm.onMove(mockEvt, mockOriginalEvt);
// Simulate cursor movement. // 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({ wrapper.setData({
currentClientX: 10, currentClientX: 10,
currentClientY: 20, currentClientY: 20,
......
...@@ -36,6 +36,8 @@ const createComponent = async (codeOwners = [codeOwnerMock]) => { ...@@ -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 }); wrapper.setData({ isFetching: false });
await waitForPromises(); await waitForPromises();
......
...@@ -69,6 +69,8 @@ describe('LockButton component', () => { ...@@ -69,6 +69,8 @@ describe('LockButton component', () => {
it('passes the correct prop if lockLoading is set to true', async () => { it('passes the correct prop if lockLoading is set to true', async () => {
createComponent(); 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 }); wrapper.setData({ lockLoading: true });
await nextTick(); await nextTick();
......
...@@ -45,6 +45,8 @@ describe('ExportRequirementsModal', () => { ...@@ -45,6 +45,8 @@ describe('ExportRequirementsModal', () => {
it("adds field if it's not selected", async () => { it("adds field if it's not selected", async () => {
const [field] = wrapper.vm.$options.fields; 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({ await wrapper.setData({
selectedFields: wrapper.vm.$options.fields.slice(1).map((f) => f.key), selectedFields: wrapper.vm.$options.fields.slice(1).map((f) => f.key),
}); });
...@@ -65,6 +67,8 @@ describe('ExportRequirementsModal', () => { ...@@ -65,6 +67,8 @@ describe('ExportRequirementsModal', () => {
it('returns false when field is in selectedFields', async () => { it('returns false when field is in selectedFields', async () => {
const [field] = wrapper.vm.$options.fields; 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({ await wrapper.setData({
selectedFields: wrapper.vm.$options.fields.slice(1).map((f) => f.key), selectedFields: wrapper.vm.$options.fields.slice(1).map((f) => f.key),
}); });
...@@ -75,6 +79,8 @@ describe('ExportRequirementsModal', () => { ...@@ -75,6 +79,8 @@ describe('ExportRequirementsModal', () => {
describe('toggleAllFields', () => { describe('toggleAllFields', () => {
it('selects all if few are selected', async () => { 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({ await wrapper.setData({
selectedFields: wrapper.vm.$options.fields.slice(1).map((f) => f.key), selectedFields: wrapper.vm.$options.fields.slice(1).map((f) => f.key),
}); });
...@@ -91,6 +97,8 @@ describe('ExportRequirementsModal', () => { ...@@ -91,6 +97,8 @@ describe('ExportRequirementsModal', () => {
}); });
it('selects all if none are selected', async () => { 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({ await wrapper.setData({
selectedFields: [], selectedFields: [],
}); });
......
...@@ -28,6 +28,8 @@ describe('ImportRequirementsModal', () => { ...@@ -28,6 +28,8 @@ describe('ImportRequirementsModal', () => {
}); });
it('returns false when file is present', () => { 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' }); wrapper.setData({ file: 'Some file' });
expect(wrapper.vm.importDisabled).toBe(false); expect(wrapper.vm.importDisabled).toBe(false);
...@@ -58,6 +60,8 @@ describe('ImportRequirementsModal', () => { ...@@ -58,6 +60,8 @@ describe('ImportRequirementsModal', () => {
it('GlModal open click emits file and projectPath', () => { it('GlModal open click emits file and projectPath', () => {
const file = 'some file'; 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({ wrapper.setData({
file, file,
}); });
......
...@@ -234,6 +234,8 @@ describe('RequirementForm', () => { ...@@ -234,6 +234,8 @@ describe('RequirementForm', () => {
it(`returns ${newLastTestReportState} when \`satisfied\` has changed from ${ it(`returns ${newLastTestReportState} when \`satisfied\` has changed from ${
requirement.satisfied requirement.satisfied
} to ${!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({ wrapperWithRequirement.setData({
satisfied: !requirement.satisfied, satisfied: !requirement.satisfied,
}); });
......
...@@ -165,6 +165,8 @@ describe('RequirementsRoot', () => { ...@@ -165,6 +165,8 @@ describe('RequirementsRoot', () => {
}); });
it('returns `true` when `requirements.list` is empty', () => { 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({ wrapper.setData({
requirements: { requirements: {
list: [], list: [],
...@@ -177,6 +179,8 @@ describe('RequirementsRoot', () => { ...@@ -177,6 +179,8 @@ describe('RequirementsRoot', () => {
}); });
it('returns `true` when `requirementsCount` for current filterBy value is 0', () => { 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({ wrapper.setData({
filterBy: FilterState.opened, filterBy: FilterState.opened,
requirementsCount: { requirementsCount: {
...@@ -192,6 +196,8 @@ describe('RequirementsRoot', () => { ...@@ -192,6 +196,8 @@ describe('RequirementsRoot', () => {
describe('totalRequirementsForCurrentTab', () => { describe('totalRequirementsForCurrentTab', () => {
it('returns number representing total requirements for current tab', () => { 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({ wrapper.setData({
filterBy: FilterState.opened, filterBy: FilterState.opened,
requirementsCount: { requirementsCount: {
...@@ -207,6 +213,8 @@ describe('RequirementsRoot', () => { ...@@ -207,6 +213,8 @@ describe('RequirementsRoot', () => {
describe('showEmptyState', () => { describe('showEmptyState', () => {
it('returns `false` when `showRequirementCreateDrawer` is true', () => { 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({ wrapper.setData({
showRequirementCreateDrawer: true, showRequirementCreateDrawer: true,
}); });
...@@ -219,6 +227,8 @@ describe('RequirementsRoot', () => { ...@@ -219,6 +227,8 @@ describe('RequirementsRoot', () => {
describe('showPaginationControls', () => { describe('showPaginationControls', () => {
it('returns `true` when totalRequirements is more than default page size', () => { 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({ wrapper.setData({
requirements: { requirements: {
list: mockRequirementsOpen, list: mockRequirementsOpen,
...@@ -233,6 +243,8 @@ describe('RequirementsRoot', () => { ...@@ -233,6 +243,8 @@ describe('RequirementsRoot', () => {
}); });
it('returns `false` when totalRequirements is less than default page size', () => { 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({ wrapper.setData({
requirements: { requirements: {
list: [mockRequirementsOpen[0]], list: [mockRequirementsOpen[0]],
...@@ -260,6 +272,8 @@ describe('RequirementsRoot', () => { ...@@ -260,6 +272,8 @@ describe('RequirementsRoot', () => {
`( `(
'returns $isVisible when hasPreviousPage is $hasPreviousPage and hasNextPage is $hasNextPage within `requirements.pageInfo`', 'returns $isVisible when hasPreviousPage is $hasPreviousPage and hasNextPage is $hasNextPage within `requirements.pageInfo`',
({ hasPreviousPage, hasNextPage, isVisible }) => { ({ 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({ wrapper.setData({
requirements: { requirements: {
pageInfo: { pageInfo: {
...@@ -278,6 +292,8 @@ describe('RequirementsRoot', () => { ...@@ -278,6 +292,8 @@ describe('RequirementsRoot', () => {
describe('prevPage', () => { describe('prevPage', () => {
it('returns number representing previous page based on currentPage value', () => { 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({ wrapper.setData({
currentPage: 3, currentPage: 3,
}); });
...@@ -294,6 +310,8 @@ describe('RequirementsRoot', () => { ...@@ -294,6 +310,8 @@ describe('RequirementsRoot', () => {
}); });
it('returns `null` when currentPage is already last page', () => { 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({ wrapper.setData({
currentPage: 2, currentPage: 2,
}); });
...@@ -328,6 +346,8 @@ describe('RequirementsRoot', () => { ...@@ -328,6 +346,8 @@ describe('RequirementsRoot', () => {
describe('getFilteredSearchValue', () => { describe('getFilteredSearchValue', () => {
it('returns array containing applied filter search values', () => { 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({ wrapper.setData({
authorUsernames: ['root', 'john.doe'], authorUsernames: ['root', 'john.doe'],
status: 'satisfied', status: 'satisfied',
...@@ -342,6 +362,8 @@ describe('RequirementsRoot', () => { ...@@ -342,6 +362,8 @@ describe('RequirementsRoot', () => {
describe('updateUrl', () => { describe('updateUrl', () => {
it('updates window URL based on presence of props for filtered search and sort criteria', () => { 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({ wrapper.setData({
filterBy: FilterState.all, filterBy: FilterState.all,
currentPage: 2, currentPage: 2,
...@@ -713,6 +735,8 @@ describe('RequirementsRoot', () => { ...@@ -713,6 +735,8 @@ describe('RequirementsRoot', () => {
describe('handleNewRequirementCancel', () => { describe('handleNewRequirementCancel', () => {
it('sets `showRequirementCreateDrawer` prop to `false`', () => { 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({ wrapper.setData({
showRequirementCreateDrawer: true, showRequirementCreateDrawer: true,
}); });
...@@ -861,6 +885,8 @@ describe('RequirementsRoot', () => { ...@@ -861,6 +885,8 @@ describe('RequirementsRoot', () => {
}); });
it('updates props `textSearch` and `authorUsernames` with empty values when passed filters param is empty', () => { 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({ wrapper.setData({
authorUsernames: ['root'], authorUsernames: ['root'],
status: 'satisfied', status: 'satisfied',
...@@ -892,6 +918,8 @@ describe('RequirementsRoot', () => { ...@@ -892,6 +918,8 @@ describe('RequirementsRoot', () => {
describe('handlePageChange', () => { describe('handlePageChange', () => {
it('sets data prop `prevPageCursor` to empty string and `nextPageCursor` to `requirements.pageInfo.endCursor` when provided page param is greater than currentPage', () => { 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({ wrapper.setData({
requirements: { requirements: {
list: mockRequirementsOpen, list: mockRequirementsOpen,
...@@ -917,6 +945,8 @@ describe('RequirementsRoot', () => { ...@@ -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', () => { 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({ wrapper.setData({
requirements: { requirements: {
list: mockRequirementsOpen, list: mockRequirementsOpen,
...@@ -967,6 +997,8 @@ describe('RequirementsRoot', () => { ...@@ -967,6 +997,8 @@ describe('RequirementsRoot', () => {
}); });
it('renders empty state when query results are empty', () => { 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({ wrapper.setData({
requirements: { requirements: {
list: [], list: [],
...@@ -998,6 +1030,8 @@ describe('RequirementsRoot', () => { ...@@ -998,6 +1030,8 @@ describe('RequirementsRoot', () => {
}); });
it('does not render requirement-empty-state component when `showRequirementCreateDrawer` prop is `true`', () => { 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({ wrapper.setData({
showRequirementCreateDrawer: true, showRequirementCreateDrawer: true,
}); });
...@@ -1008,6 +1042,8 @@ describe('RequirementsRoot', () => { ...@@ -1008,6 +1042,8 @@ describe('RequirementsRoot', () => {
}); });
it('renders requirement items for all the requirements', () => { 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({ wrapper.setData({
requirements: { requirements: {
list: mockRequirementsOpen, list: mockRequirementsOpen,
...@@ -1025,6 +1061,8 @@ describe('RequirementsRoot', () => { ...@@ -1025,6 +1061,8 @@ describe('RequirementsRoot', () => {
}); });
it('renders pagination controls', () => { 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({ wrapper.setData({
requirements: { requirements: {
list: mockRequirementsOpen, list: mockRequirementsOpen,
......
...@@ -55,6 +55,8 @@ describe('CurrentDayIndicator', () => { ...@@ -55,6 +55,8 @@ describe('CurrentDayIndicator', () => {
describe('computed', () => { describe('computed', () => {
describe('hasToday', () => { describe('hasToday', () => {
it('returns true when presetType is QUARTERS and currentDate is within current quarter', () => { 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({ wrapper.setData({
currentDate: mockTimeframeQuarters[0].range[1], currentDate: mockTimeframeQuarters[0].range[1],
}); });
...@@ -70,6 +72,8 @@ describe('CurrentDayIndicator', () => { ...@@ -70,6 +72,8 @@ describe('CurrentDayIndicator', () => {
}); });
it('returns true when presetType is MONTHS and currentDate is within current month', () => { 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({ wrapper.setData({
currentDate: new Date(2020, 0, 15), currentDate: new Date(2020, 0, 15),
}); });
...@@ -85,6 +89,8 @@ describe('CurrentDayIndicator', () => { ...@@ -85,6 +89,8 @@ describe('CurrentDayIndicator', () => {
}); });
it('returns true when presetType is WEEKS and currentDate is within current week', () => { 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({ wrapper.setData({
currentDate: mockTimeframeWeeks[0], currentDate: mockTimeframeWeeks[0],
}); });
...@@ -104,6 +110,8 @@ describe('CurrentDayIndicator', () => { ...@@ -104,6 +110,8 @@ describe('CurrentDayIndicator', () => {
describe('methods', () => { describe('methods', () => {
describe('getIndicatorStyles', () => { describe('getIndicatorStyles', () => {
it('returns object containing `left` with value `34%` when presetType is QUARTERS', () => { 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({ wrapper.setData({
currentDate: mockTimeframeQuarters[0].range[1], currentDate: mockTimeframeQuarters[0].range[1],
}); });
...@@ -123,6 +131,8 @@ describe('CurrentDayIndicator', () => { ...@@ -123,6 +131,8 @@ describe('CurrentDayIndicator', () => {
}); });
it('returns object containing `left` with value `48%` when presetType is MONTHS', () => { 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({ wrapper.setData({
currentDate: new Date(2020, 0, 15), currentDate: new Date(2020, 0, 15),
}); });
...@@ -142,6 +152,8 @@ describe('CurrentDayIndicator', () => { ...@@ -142,6 +152,8 @@ describe('CurrentDayIndicator', () => {
}); });
it('returns object containing `left` with value `7%` when presetType is WEEKS', () => { 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({ wrapper.setData({
currentDate: mockTimeframeWeeks[0], currentDate: mockTimeframeWeeks[0],
}); });
...@@ -165,6 +177,8 @@ describe('CurrentDayIndicator', () => { ...@@ -165,6 +177,8 @@ describe('CurrentDayIndicator', () => {
describe('template', () => { describe('template', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createComponent(); 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({ wrapper.setData({
currentDate: mockTimeframeMonths[0], currentDate: mockTimeframeMonths[0],
}); });
......
...@@ -287,6 +287,8 @@ describe('EpicsListSectionComponent', () => { ...@@ -287,6 +287,8 @@ describe('EpicsListSectionComponent', () => {
}); });
it('renders bottom shadow element when `showBottomShadow` prop is true', () => { 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({ wrapper.setData({
showBottomShadow: true, showBottomShadow: true,
}); });
......
...@@ -167,6 +167,8 @@ describe('MilestonesListSectionComponent', () => { ...@@ -167,6 +167,8 @@ describe('MilestonesListSectionComponent', () => {
}); });
it('renders bottom shadow element when `showBottomShadow` prop is true', () => { 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({ wrapper.setData({
showBottomShadow: true, showBottomShadow: true,
}); });
......
...@@ -131,6 +131,8 @@ describe('RoadmapFilters', () => { ...@@ -131,6 +131,8 @@ describe('RoadmapFilters', () => {
}); });
it('switching layout using roadmap layout switching buttons causes page to reload with selected layout', async () => { 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 }); wrapper.setData({ selectedDaterange: DATE_RANGES.THREE_YEARS });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
...@@ -341,6 +343,8 @@ describe('RoadmapFilters', () => { ...@@ -341,6 +343,8 @@ describe('RoadmapFilters', () => {
}); });
it('renders daterange dropdown', async () => { 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 }); wrapperWithDaterangeFilter.setData({ selectedDaterange: DATE_RANGES.CURRENT_QUARTER });
await wrapperWithDaterangeFilter.vm.$nextTick(); await wrapperWithDaterangeFilter.vm.$nextTick();
...@@ -362,6 +366,8 @@ describe('RoadmapFilters', () => { ...@@ -362,6 +366,8 @@ describe('RoadmapFilters', () => {
`( `(
'renders $availablePresets.length items when selected daterange is "$selectedDaterange"', 'renders $availablePresets.length items when selected daterange is "$selectedDaterange"',
async ({ selectedDaterange, availablePresets }) => { 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 }); wrapperWithDaterangeFilter.setData({ selectedDaterange });
await wrapperWithDaterangeFilter.vm.$nextTick(); await wrapperWithDaterangeFilter.vm.$nextTick();
......
...@@ -191,6 +191,8 @@ describe('EE - DastProfiles', () => { ...@@ -191,6 +191,8 @@ describe('EE - DastProfiles', () => {
async ({ profileType, key, givenData, expectedValue, exposedAsProp }) => { async ({ profileType, key, givenData, expectedValue, exposedAsProp }) => {
const propGetter = exposedAsProp ? 'props' : 'attributes'; const propGetter = exposedAsProp ? 'props' : 'attributes';
createComponent(); 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({ wrapper.setData({
profileTypes: { [profileType]: givenData }, profileTypes: { [profileType]: givenData },
}); });
......
...@@ -89,6 +89,8 @@ describe('Group Security Dashboard component', () => { ...@@ -89,6 +89,8 @@ describe('Group Security Dashboard component', () => {
it('renders the default page', async () => { it('renders the default page', async () => {
createWrapper(); 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' }] }); wrapper.setData({ projects: [{ name: 'project1' }] });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
......
...@@ -71,6 +71,8 @@ describe('Group Security Dashboard Vulnerabilities Component', () => { ...@@ -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({ wrapper.setData({
errorLoadingVulnerabilities: true, errorLoadingVulnerabilities: true,
}); });
...@@ -105,6 +107,8 @@ describe('Group Security Dashboard Vulnerabilities Component', () => { ...@@ -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({ wrapper.setData({
vulnerabilities, vulnerabilities,
}); });
...@@ -151,6 +155,8 @@ describe('Group Security Dashboard Vulnerabilities Component', () => { ...@@ -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({ wrapper.setData({
vulnerabilities, vulnerabilities,
pageInfo: { pageInfo: {
...@@ -172,6 +178,8 @@ describe('Group Security Dashboard Vulnerabilities Component', () => { ...@@ -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({ wrapper.setData({
vulnerabilities: generateVulnerabilities(), vulnerabilities: generateVulnerabilities(),
pageInfo: { pageInfo: {
......
...@@ -92,6 +92,8 @@ describe('Instance Security Dashboard component', () => { ...@@ -92,6 +92,8 @@ describe('Instance Security Dashboard component', () => {
it('renders the default page', async () => { it('renders the default page', async () => {
createWrapper(); 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' }] }); wrapper.setData({ projects: [{ name: 'project1' }] });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
......
...@@ -145,6 +145,8 @@ describe('Security reports summary component', () => { ...@@ -145,6 +145,8 @@ describe('Security reports summary component', () => {
}); });
it('set local storage item to 1 when summary is hidden', async () => { 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 }); wrapper.setData({ isVisible: false });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
...@@ -163,6 +165,8 @@ describe('Security reports summary component', () => { ...@@ -163,6 +165,8 @@ describe('Security reports summary component', () => {
}); });
it('removes local storage item when summary is shown', async () => { 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 }); wrapper.setData({ isVisible: true });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
......
...@@ -90,6 +90,8 @@ describe('Vulnerabilities app component', () => { ...@@ -90,6 +90,8 @@ describe('Vulnerabilities app component', () => {
createWrapper(); createWrapper();
vulnerabilities = generateVulnerabilities(); 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 }); wrapper.setData({ vulnerabilities });
}); });
...@@ -135,6 +137,8 @@ describe('Vulnerabilities app component', () => { ...@@ -135,6 +137,8 @@ describe('Vulnerabilities app component', () => {
createWrapper(); createWrapper();
vulnerabilities = generateVulnerabilities(); 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({ wrapper.setData({
vulnerabilities, vulnerabilities,
pageInfo: { pageInfo: {
...@@ -155,6 +159,8 @@ describe('Vulnerabilities app component', () => { ...@@ -155,6 +159,8 @@ describe('Vulnerabilities app component', () => {
describe(`when there's an error loading vulnerabilities`, () => { describe(`when there's an error loading vulnerabilities`, () => {
beforeEach(() => { beforeEach(() => {
createWrapper(); 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 }); wrapper.setData({ errorLoadingVulnerabilities: true });
}); });
......
...@@ -115,6 +115,8 @@ describe('Csv Button Export', () => { ...@@ -115,6 +115,8 @@ describe('Csv Button Export', () => {
loading: false, 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 }); wrapper.setData({ isPreparingCsvExport: true });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
......
...@@ -112,6 +112,8 @@ describe('Scanner Filter component', () => { ...@@ -112,6 +112,8 @@ describe('Scanner Filter component', () => {
}; };
const selectedOptions = sampleSize(filter.options, 3); // Randomly select some options. 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 }); await wrapper.setData({ selectedOptions });
expectSelectedItems(selectedOptions); expectSelectedItems(selectedOptions);
......
...@@ -58,6 +58,8 @@ describe('Vulnerabilities count list component', () => { ...@@ -58,6 +58,8 @@ describe('Vulnerabilities count list component', () => {
describe('when counts are loaded', () => { describe('when counts are loaded', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createWrapper({ query: { loading: false } }); 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({ wrapper.setData({
vulnerabilitiesCount: { vulnerabilitiesCount: {
critical: 5, critical: 5,
......
...@@ -254,6 +254,8 @@ describe('Status', () => { ...@@ -254,6 +254,8 @@ describe('Status', () => {
mountStatus(props); 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 }); wrapper.setData({ isDropdownShowing: true });
}); });
...@@ -292,6 +294,8 @@ describe('Status', () => { ...@@ -292,6 +294,8 @@ describe('Status', () => {
mountStatus(props); 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 }); wrapper.setData({ isDropdownShowing: true });
}); });
......
...@@ -179,6 +179,8 @@ describe('TestCaseCreateRoot', () => { ...@@ -179,6 +179,8 @@ describe('TestCaseCreateRoot', () => {
}); });
it('submit button shows loading animation when `createTestCaseRequestActive` is true', async () => { 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({ wrapper.setData({
createTestCaseRequestActive: true, createTestCaseRequestActive: true,
}); });
...@@ -189,6 +191,8 @@ describe('TestCaseCreateRoot', () => { ...@@ -189,6 +191,8 @@ describe('TestCaseCreateRoot', () => {
}); });
it('cancel button is disabled when `createTestCaseRequestActive` is true', async () => { 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({ wrapper.setData({
createTestCaseRequestActive: true, createTestCaseRequestActive: true,
}); });
......
...@@ -166,6 +166,8 @@ describe('TestCaseListRoot', () => { ...@@ -166,6 +166,8 @@ describe('TestCaseListRoot', () => {
}); });
it('returns number representing next page based on currentPage value', async () => { 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({ wrapper.setData({
currentPage: 1, currentPage: 1,
}); });
...@@ -176,6 +178,8 @@ describe('TestCaseListRoot', () => { ...@@ -176,6 +178,8 @@ describe('TestCaseListRoot', () => {
}); });
it('returns `null` when currentPage is already last page', async () => { 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({ wrapper.setData({
currentPage: 3, currentPage: 3,
}); });
...@@ -229,6 +233,8 @@ describe('TestCaseListRoot', () => { ...@@ -229,6 +233,8 @@ describe('TestCaseListRoot', () => {
}); });
it('page-change event changes prevPageCursor and nextPageCursor values based on based on currentPage and calls updateUrl', async () => { 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({ await wrapper.setData({
testCases: { testCases: {
pageInfo: mockPageInfo, pageInfo: mockPageInfo,
......
...@@ -85,6 +85,8 @@ describe('TestCaseShowRoot', () => { ...@@ -85,6 +85,8 @@ describe('TestCaseShowRoot', () => {
testCaseActionTitle, testCaseActionTitle,
}) => { }) => {
beforeEach(async () => { 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({ wrapper.setData({
testCase: { testCase: {
...mockTestCase, ...mockTestCase,
...@@ -235,6 +237,8 @@ describe('TestCaseShowRoot', () => { ...@@ -235,6 +237,8 @@ describe('TestCaseShowRoot', () => {
describe('handleCancelClick', () => { describe('handleCancelClick', () => {
it('sets `editTestCaseFormVisible` prop to false and emits "close.form" even in IssuableEventHub', async () => { 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({ wrapper.setData({
editTestCaseFormVisible: true, editTestCaseFormVisible: true,
}); });
...@@ -264,6 +268,8 @@ describe('TestCaseShowRoot', () => { ...@@ -264,6 +268,8 @@ describe('TestCaseShowRoot', () => {
describe('template', () => { describe('template', () => {
it('renders gl-loading-icon when testCaseLoading prop is true', async () => { 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({ wrapper.setData({
testCaseLoading: true, testCaseLoading: true,
}); });
...@@ -319,6 +325,8 @@ describe('TestCaseShowRoot', () => { ...@@ -319,6 +325,8 @@ describe('TestCaseShowRoot', () => {
}); });
it('does not render issuable-show when `testCaseLoading` prop is false and `testCaseLoadFailed` prop is true', async () => { 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({ wrapper.setData({
testCaseLoading: false, testCaseLoading: false,
testCaseLoadFailed: true, testCaseLoadFailed: true,
...@@ -361,6 +369,8 @@ describe('TestCaseShowRoot', () => { ...@@ -361,6 +369,8 @@ describe('TestCaseShowRoot', () => {
}); });
it('renders edit-form-actions slot contents', async () => { 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({ wrapper.setData({
editTestCaseFormVisible: true, editTestCaseFormVisible: true,
}); });
......
...@@ -86,6 +86,8 @@ describe('TestCaseSidebar', () => { ...@@ -86,6 +86,8 @@ describe('TestCaseSidebar', () => {
`( `(
'returns $returnValue when testCaseMoveInProgress is $testCaseMoveInProgress', 'returns $returnValue when testCaseMoveInProgress is $testCaseMoveInProgress',
async ({ testCaseMoveInProgress, returnValue }) => { 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({ wrapper.setData({
testCaseMoveInProgress, testCaseMoveInProgress,
}); });
...@@ -197,6 +199,8 @@ describe('TestCaseSidebar', () => { ...@@ -197,6 +199,8 @@ describe('TestCaseSidebar', () => {
describe('handleSidebarDropdownClose', () => { describe('handleSidebarDropdownClose', () => {
it('sets `sidebarExpandedOnClick` to false and calls `toggleSidebar` method when `sidebarExpandedOnClick` is true', async () => { it('sets `sidebarExpandedOnClick` to false and calls `toggleSidebar` method when `sidebarExpandedOnClick` is true', async () => {
jest.spyOn(wrapper.vm, 'toggleSidebar').mockImplementation(jest.fn()); 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({ wrapper.setData({
sidebarExpandedOnClick: true, sidebarExpandedOnClick: true,
}); });
......
...@@ -262,6 +262,8 @@ describe('AlertsList component', () => { ...@@ -262,6 +262,8 @@ describe('AlertsList component', () => {
}); });
it('does not show the unconfigured alert error state when there is a request error', async () => { 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({ wrapper.setData({
errored: true, errored: true,
}); });
...@@ -271,6 +273,8 @@ describe('AlertsList component', () => { ...@@ -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 () => { 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({ wrapper.setData({
isErrorAlertDismissed: true, isErrorAlertDismissed: true,
}); });
......
...@@ -73,6 +73,8 @@ describe('NamespaceStorageApp', () => { ...@@ -73,6 +73,8 @@ describe('NamespaceStorageApp', () => {
}); });
it('renders the 2 projects', async () => { 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({ wrapper.setData({
namespace: namespaceData, namespace: namespaceData,
}); });
...@@ -84,6 +86,8 @@ describe('NamespaceStorageApp', () => { ...@@ -84,6 +86,8 @@ describe('NamespaceStorageApp', () => {
describe('limit', () => { describe('limit', () => {
it('when limit is set it renders limit information', async () => { 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({ wrapper.setData({
namespace: namespaceData, namespace: namespaceData,
}); });
...@@ -94,6 +98,8 @@ describe('NamespaceStorageApp', () => { ...@@ -94,6 +98,8 @@ describe('NamespaceStorageApp', () => {
}); });
it('when limit is 0 it does not render limit information', async () => { 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({ wrapper.setData({
namespace: { ...namespaceData, limit: 0 }, namespace: { ...namespaceData, limit: 0 },
}); });
...@@ -106,6 +112,8 @@ describe('NamespaceStorageApp', () => { ...@@ -106,6 +112,8 @@ describe('NamespaceStorageApp', () => {
describe('with rootStorageStatistics information', () => { describe('with rootStorageStatistics information', () => {
it('renders total usage', async () => { 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({ wrapper.setData({
namespace: withRootStorageStatistics, namespace: withRootStorageStatistics,
}); });
...@@ -118,6 +126,8 @@ describe('NamespaceStorageApp', () => { ...@@ -118,6 +126,8 @@ describe('NamespaceStorageApp', () => {
describe('with additional_repo_storage_by_namespace feature', () => { describe('with additional_repo_storage_by_namespace feature', () => {
it('usage_graph component hidden is when feature is false', async () => { 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({ wrapper.setData({
namespace: withRootStorageStatistics, namespace: withRootStorageStatistics,
}); });
...@@ -145,6 +155,8 @@ describe('NamespaceStorageApp', () => { ...@@ -145,6 +155,8 @@ describe('NamespaceStorageApp', () => {
describe('without rootStorageStatistics information', () => { describe('without rootStorageStatistics information', () => {
it('renders N/A', async () => { 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({ wrapper.setData({
namespace: namespaceData, namespace: namespaceData,
}); });
...@@ -195,6 +207,8 @@ describe('NamespaceStorageApp', () => { ...@@ -195,6 +207,8 @@ describe('NamespaceStorageApp', () => {
describe('when temporary storage increase is visible', () => { describe('when temporary storage increase is visible', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ provide: { isTemporaryStorageIncreaseVisible: 'true' } }); 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({ wrapper.setData({
namespace: { namespace: {
...namespaceData, ...namespaceData,
......
...@@ -107,6 +107,8 @@ describe('ReadyToMerge', () => { ...@@ -107,6 +107,8 @@ describe('ReadyToMerge', () => {
it('should return "Merge in progress"', () => { it('should return "Merge in progress"', () => {
factory(); 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 }); wrapper.setData({ isMergingImmediately: true });
expect(vm.mergeButtonText).toEqual('Merge in progress'); expect(vm.mergeButtonText).toEqual('Merge in progress');
......
...@@ -141,6 +141,8 @@ describe('AccordionItem component', () => { ...@@ -141,6 +141,8 @@ describe('AccordionItem component', () => {
}); });
it('collapses if "closeOtherAccordionItems" is called with the trigger not being the current item', () => { 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.setData({ isExpanded: true });
wrapper.vm.onCloseOtherAccordionItems({}); wrapper.vm.onCloseOtherAccordionItems({});
...@@ -148,6 +150,8 @@ describe('AccordionItem component', () => { ...@@ -148,6 +150,8 @@ describe('AccordionItem component', () => {
}); });
it('does not collapses if "closeOtherAccordionItems" is called with the trigger being the current item', () => { 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.setData({ isExpanded: true });
wrapper.vm.onCloseOtherAccordionItems(wrapper.vm); wrapper.vm.onCloseOtherAccordionItems(wrapper.vm);
...@@ -177,6 +181,8 @@ describe('AccordionItem component', () => { ...@@ -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', () => { 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(); 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 }); wrapper.setData({ isExpanded: true });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
......
...@@ -55,6 +55,8 @@ describe('IterationToken', () => { ...@@ -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 }); await wrapper.setData({ loading: false });
}); });
......
...@@ -34,6 +34,8 @@ describe('AddLicenseForm', () => { ...@@ -34,6 +34,8 @@ describe('AddLicenseForm', () => {
createComponent({}, mount); createComponent({}, mount);
jest.spyOn(vm, '$emit').mockImplementation(() => {}); 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 }); wrapper.setData({ approvalStatus: LICENSE_APPROVAL_STATUS.ALLOWED, licenseName: name });
await Vue.nextTick(); await Vue.nextTick();
...@@ -60,12 +62,16 @@ describe('AddLicenseForm', () => { ...@@ -60,12 +62,16 @@ describe('AddLicenseForm', () => {
describe('computed', () => { describe('computed', () => {
describe('submitDisabled', () => { describe('submitDisabled', () => {
it('is true if the approvalStatus is empty', () => { 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: '' }); wrapper.setData({ licenseName: 'FOO', approvalStatus: '' });
expect(vm.submitDisabled).toBe(true); expect(vm.submitDisabled).toBe(true);
}); });
it('is true if the licenseName is empty', () => { 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 }); wrapper.setData({ licenseName: '', approvalStatus: LICENSE_APPROVAL_STATUS.ALLOWED });
expect(vm.submitDisabled).toBe(true); expect(vm.submitDisabled).toBe(true);
...@@ -73,6 +79,8 @@ describe('AddLicenseForm', () => { ...@@ -73,6 +79,8 @@ describe('AddLicenseForm', () => {
it('is true if the entered license is duplicated', () => { it('is true if the entered license is duplicated', () => {
createComponent({ managedLicenses: [{ name: 'FOO' }] }); 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 }); wrapper.setData({ licenseName: 'FOO', approvalStatus: LICENSE_APPROVAL_STATUS.ALLOWED });
expect(vm.submitDisabled).toBe(true); expect(vm.submitDisabled).toBe(true);
...@@ -82,6 +90,8 @@ describe('AddLicenseForm', () => { ...@@ -82,6 +90,8 @@ describe('AddLicenseForm', () => {
describe('isInvalidLicense', () => { describe('isInvalidLicense', () => {
it('is true if the entered license is duplicated', () => { it('is true if the entered license is duplicated', () => {
createComponent({ managedLicenses: [{ name: 'FOO' }] }); 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' }); wrapper.setData({ licenseName: 'FOO' });
expect(vm.isInvalidLicense).toBe(true); expect(vm.isInvalidLicense).toBe(true);
...@@ -89,6 +99,8 @@ describe('AddLicenseForm', () => { ...@@ -89,6 +99,8 @@ describe('AddLicenseForm', () => {
it('is false if the entered license is unique', () => { it('is false if the entered license is unique', () => {
createComponent({ managedLicenses: [{ name: 'FOO' }] }); 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' }); wrapper.setData({ licenseName: 'FOO2' });
expect(vm.isInvalidLicense).toBe(false); expect(vm.isInvalidLicense).toBe(false);
...@@ -126,6 +138,8 @@ describe('AddLicenseForm', () => { ...@@ -126,6 +138,8 @@ describe('AddLicenseForm', () => {
it('renders error text, if there is a duplicate license', async () => { it('renders error text, if there is a duplicate license', async () => {
createComponent({ managedLicenses: [{ name: 'FOO' }] }); 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' }); wrapper.setData({ licenseName: 'FOO' });
await Vue.nextTick(); await Vue.nextTick();
...@@ -156,6 +170,8 @@ describe('AddLicenseForm', () => { ...@@ -156,6 +170,8 @@ describe('AddLicenseForm', () => {
}); });
it('disables submit, if the form is invalid', async () => { 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: '' }); wrapper.setData({ licenseName: '' });
await Vue.nextTick(); await Vue.nextTick();
......
...@@ -54,6 +54,8 @@ describe('New vulnerability - Section Name', () => { ...@@ -54,6 +54,8 @@ describe('New vulnerability - Section Name', () => {
${'Name'} | ${GlFormInput} | ${{ vulnerabilityName: 'CVE 2021', vulnerabilityDesc: '' }} ${'Name'} | ${GlFormInput} | ${{ vulnerabilityName: 'CVE 2021', vulnerabilityDesc: '' }}
${'Description'} | ${GlFormTextarea} | ${{ vulnerabilityName: '', vulnerabilityDesc: 'Password leak' }} ${'Description'} | ${GlFormTextarea} | ${{ vulnerabilityName: '', vulnerabilityDesc: 'Password leak' }}
`('emits the changes: $field ', async ({ component, value }) => { `('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.setData(value);
wrapper.findComponent(component).vm.$emit('change', value); wrapper.findComponent(component).vm.$emit('change', value);
expect(wrapper.emitted('change')[0][0]).toEqual(value); expect(wrapper.emitted('change')[0][0]).toEqual(value);
......
...@@ -95,10 +95,7 @@ module QA ...@@ -95,10 +95,7 @@ module QA
# #
# @return [Fog::Storage::GoogleJSON] # @return [Fog::Storage::GoogleJSON]
def client def client
@client ||= Fog::Storage::Google.new( @client ||= Fog::Storage::Google.new(google_project: PROJECT, **gcs_credentials)
google_project: PROJECT,
google_json_key_location: gcs_credentials
)
end end
# Base path of knapsack report # Base path of knapsack report
...@@ -132,13 +129,16 @@ module QA ...@@ -132,13 +129,16 @@ module QA
@report_name ||= ENV["CI_JOB_NAME"].split(" ").first.tr(":", "-") @report_name ||= ENV["CI_JOB_NAME"].split(" ").first.tr(":", "-")
end end
# Path to GCS credentials json # GCS credentials json
# #
# @return [String] # @return [Hash]
def gcs_credentials def gcs_credentials
@gcs_credentials ||= ENV["QA_KNAPSACK_REPORT_GCS_CREDENTIALS"] || raise( json_key = ENV["QA_KNAPSACK_REPORT_GCS_CREDENTIALS"] || raise(
"QA_KNAPSACK_REPORT_GCS_CREDENTIALS env variable is required!" "QA_KNAPSACK_REPORT_GCS_CREDENTIALS env variable is required!"
) )
return { google_json_key_location: json_key } if File.exist?(json_key)
{ google_json_key_string: json_key }
end end
end end
end end
......
...@@ -319,6 +319,8 @@ describe('AlertsSettingsForm', () => { ...@@ -319,6 +319,8 @@ describe('AlertsSettingsForm', () => {
const validPayloadMsg = payload === emptySamplePayload ? 'not valid' : 'valid'; const validPayloadMsg = payload === emptySamplePayload ? 'not valid' : 'valid';
it(`textarea should be ${enabledState} when payload reset ${payloadResetMsg} and payload is ${validPayloadMsg}`, async () => { it(`textarea should be ${enabledState} when payload reset ${payloadResetMsg} and payload is ${validPayloadMsg}`, 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({ wrapper.setData({
currentIntegration: { payloadExample: payload }, currentIntegration: { payloadExample: payload },
resetPayloadAndMappingConfirmed, resetPayloadAndMappingConfirmed,
...@@ -345,6 +347,8 @@ describe('AlertsSettingsForm', () => { ...@@ -345,6 +347,8 @@ describe('AlertsSettingsForm', () => {
: 'was not confirmed'; : 'was not confirmed';
it(`shows ${caption} button when sample payload ${samplePayloadMsg} and payload reset ${payloadResetMsg}`, async () => { it(`shows ${caption} button when sample payload ${samplePayloadMsg} and payload reset ${payloadResetMsg}`, 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({ wrapper.setData({
currentIntegration: { currentIntegration: {
payloadExample, payloadExample,
...@@ -359,6 +363,8 @@ describe('AlertsSettingsForm', () => { ...@@ -359,6 +363,8 @@ describe('AlertsSettingsForm', () => {
describe('Parsing payload', () => { describe('Parsing payload', () => {
beforeEach(() => { 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({ wrapper.setData({
resetPayloadAndMappingConfirmed: true, resetPayloadAndMappingConfirmed: true,
}); });
...@@ -456,6 +462,8 @@ describe('AlertsSettingsForm', () => { ...@@ -456,6 +462,8 @@ describe('AlertsSettingsForm', () => {
}); });
it('should be able to submit when form is dirty', async () => { it('should be able to submit when form is dirty', 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({ wrapper.setData({
currentIntegration: { type: typeSet.http, name: 'Existing integration' }, currentIntegration: { type: typeSet.http, name: 'Existing integration' },
}); });
...@@ -466,6 +474,8 @@ describe('AlertsSettingsForm', () => { ...@@ -466,6 +474,8 @@ describe('AlertsSettingsForm', () => {
}); });
it('should not be able to submit when form is pristine', async () => { it('should not be able to submit when form is pristine', 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({ wrapper.setData({
currentIntegration: { type: typeSet.http, name: 'Existing integration' }, currentIntegration: { type: typeSet.http, name: 'Existing integration' },
}); });
......
...@@ -126,6 +126,8 @@ describe('ProjectsDropdownFilter component', () => { ...@@ -126,6 +126,8 @@ describe('ProjectsDropdownFilter component', () => {
}); });
it('applies the correct queryParams when making an api call', async () => { it('applies the correct queryParams when making an api call', 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({ searchTerm: 'gitlab' }); wrapper.setData({ searchTerm: 'gitlab' });
expect(spyQuery).toHaveBeenCalledTimes(1); expect(spyQuery).toHaveBeenCalledTimes(1);
...@@ -204,6 +206,8 @@ describe('ProjectsDropdownFilter component', () => { ...@@ -204,6 +206,8 @@ describe('ProjectsDropdownFilter component', () => {
await createWithMockDropdown({ multiSelect: true }); await createWithMockDropdown({ multiSelect: true });
selectDropdownItemAtIndex(0); selectDropdownItemAtIndex(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({ searchTerm: 'this is a very long search string' }); wrapper.setData({ searchTerm: 'this is a very long search string' });
}); });
......
...@@ -44,6 +44,8 @@ describe('Blob Header Editing', () => { ...@@ -44,6 +44,8 @@ describe('Blob Header Editing', () => {
const inputComponent = wrapper.find(GlFormInput); const inputComponent = wrapper.find(GlFormInput);
const newValue = 'bar.txt'; const newValue = 'bar.txt';
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
name: newValue, name: newValue,
}); });
......
...@@ -96,6 +96,8 @@ describe('BoardsSelector', () => { ...@@ -96,6 +96,8 @@ describe('BoardsSelector', () => {
}); });
wrapper.vm.$apollo.addSmartQuery = jest.fn((_, options) => { 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({ wrapper.setData({
[options.loadingKey]: true, [options.loadingKey]: true,
}); });
...@@ -161,6 +163,8 @@ describe('BoardsSelector', () => { ...@@ -161,6 +163,8 @@ describe('BoardsSelector', () => {
// Emits gl-dropdown show event to simulate the dropdown is opened at initialization time // Emits gl-dropdown show event to simulate the dropdown is opened at initialization time
findDropdown().vm.$emit('show'); 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({ await wrapper.setData({
loadingBoards: false, loadingBoards: false,
loadingRecentBoards: false, loadingRecentBoards: false,
...@@ -176,6 +180,8 @@ describe('BoardsSelector', () => { ...@@ -176,6 +180,8 @@ describe('BoardsSelector', () => {
describe('filtering', () => { describe('filtering', () => {
beforeEach(async () => { 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({ wrapper.setData({
boards, boards,
}); });
...@@ -208,6 +214,8 @@ describe('BoardsSelector', () => { ...@@ -208,6 +214,8 @@ describe('BoardsSelector', () => {
describe('recent boards section', () => { describe('recent boards section', () => {
it('shows only when boards are greater than 10', async () => { it('shows only when boards are greater than 10', 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({ wrapper.setData({
boards, boards,
}); });
...@@ -217,6 +225,8 @@ describe('BoardsSelector', () => { ...@@ -217,6 +225,8 @@ describe('BoardsSelector', () => {
}); });
it('does not show when boards are less than 10', async () => { it('does not show when boards are less than 10', 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({ wrapper.setData({
boards: boards.slice(0, 5), boards: boards.slice(0, 5),
}); });
...@@ -226,6 +236,8 @@ describe('BoardsSelector', () => { ...@@ -226,6 +236,8 @@ describe('BoardsSelector', () => {
}); });
it('does not show when recentBoards api returns empty array', async () => { it('does not show when recentBoards api returns empty array', 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({ wrapper.setData({
recentBoards: [], recentBoards: [],
}); });
......
...@@ -66,6 +66,8 @@ describe('CI Lint', () => { ...@@ -66,6 +66,8 @@ describe('CI Lint', () => {
it('validate action calls mutation with dry run', async () => { it('validate action calls mutation with dry run', async () => {
const dryRunEnabled = true; const dryRunEnabled = true;
// 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({ dryRun: dryRunEnabled }); await wrapper.setData({ dryRun: dryRunEnabled });
findValidateBtn().vm.$emit('click'); findValidateBtn().vm.$emit('click');
......
...@@ -82,6 +82,8 @@ describe('ClusterIntegrationForm', () => { ...@@ -82,6 +82,8 @@ describe('ClusterIntegrationForm', () => {
.then(() => { .then(() => {
// setData is a bad approach because it changes the internal implementation which we should not touch // setData is a bad approach because it changes the internal implementation which we should not touch
// but our GlFormInput lacks the ability to set a new value. // but our GlFormInput lacks the ability to set a new 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({ toggleEnabled: !defaultStoreValues.enabled }); wrapper.setData({ toggleEnabled: !defaultStoreValues.enabled });
}) })
.then(() => { .then(() => {
...@@ -93,6 +95,8 @@ describe('ClusterIntegrationForm', () => { ...@@ -93,6 +95,8 @@ describe('ClusterIntegrationForm', () => {
return wrapper.vm return wrapper.vm
.$nextTick() .$nextTick()
.then(() => { .then(() => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ envScope: `${defaultStoreValues.environmentScope}1` }); wrapper.setData({ envScope: `${defaultStoreValues.environmentScope}1` });
}) })
.then(() => { .then(() => {
......
...@@ -272,6 +272,8 @@ describe('Clusters', () => { ...@@ -272,6 +272,8 @@ describe('Clusters', () => {
describe('when updating currentPage', () => { describe('when updating currentPage', () => {
beforeEach(() => { beforeEach(() => {
mockPollingApi(200, apiData, paginationHeader(totalSecondPage, perPage, 2)); mockPollingApi(200, apiData, paginationHeader(totalSecondPage, perPage, 2));
// 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 }); wrapper.setData({ currentPage: 2 });
return axios.waitForAll(); return axios.waitForAll();
}); });
......
...@@ -92,6 +92,8 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -92,6 +92,8 @@ describe('Pipelines table in Commits and Merge requests', () => {
it('should make an API request when using pagination', async () => { it('should make an API request when using pagination', async () => {
jest.spyOn(wrapper.vm, 'updateContent').mockImplementation(() => {}); jest.spyOn(wrapper.vm, 'updateContent').mockImplementation(() => {});
// 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({ await wrapper.setData({
store: { store: {
state: { state: {
......
...@@ -206,6 +206,8 @@ describe('ClusterFormDropdown', () => { ...@@ -206,6 +206,8 @@ describe('ClusterFormDropdown', () => {
const searchQuery = secondItem.name; const searchQuery = secondItem.name;
wrapper.setProps({ items }); wrapper.setProps({ items });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ searchQuery }); wrapper.setData({ searchQuery });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
......
...@@ -67,6 +67,8 @@ describe('ServiceCredentialsForm', () => { ...@@ -67,6 +67,8 @@ describe('ServiceCredentialsForm', () => {
}); });
it('enables submit button when role ARN is not provided', () => { it('enables submit button when role ARN is not provided', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm.setData({ roleArn: '123' }); vm.setData({ roleArn: '123' });
return vm.vm.$nextTick().then(() => { return vm.vm.$nextTick().then(() => {
...@@ -75,6 +77,8 @@ describe('ServiceCredentialsForm', () => { ...@@ -75,6 +77,8 @@ describe('ServiceCredentialsForm', () => {
}); });
it('dispatches createRole action when submit button is clicked', () => { it('dispatches createRole action when submit button is clicked', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm.setData({ roleArn: '123' }); // set role ARN to enable button vm.setData({ roleArn: '123' }); // set role ARN to enable button
findSubmitButton().vm.$emit('click', new Event('click')); findSubmitButton().vm.$emit('click', new Event('click'));
...@@ -84,6 +88,8 @@ describe('ServiceCredentialsForm', () => { ...@@ -84,6 +88,8 @@ describe('ServiceCredentialsForm', () => {
describe('when is creating role', () => { describe('when is creating role', () => {
beforeEach(() => { beforeEach(() => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm.setData({ roleArn: '123' }); // set role ARN to enable button vm.setData({ roleArn: '123' }); // set role ARN to enable button
state.isCreatingRole = true; state.isCreatingRole = true;
......
...@@ -79,6 +79,8 @@ describe('GkeMachineTypeDropdown', () => { ...@@ -79,6 +79,8 @@ describe('GkeMachineTypeDropdown', () => {
store = createStore(); store = createStore();
wrapper = createComponent(store); wrapper = createComponent(store);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isLoading: true }); wrapper.setData({ isLoading: true });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
......
...@@ -83,6 +83,8 @@ describe('GkeProjectIdDropdown', () => { ...@@ -83,6 +83,8 @@ describe('GkeProjectIdDropdown', () => {
it('returns default toggle text', () => { it('returns default toggle text', () => {
bootstrap(); bootstrap();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isLoading: false }); wrapper.setData({ isLoading: false });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
...@@ -99,6 +101,8 @@ describe('GkeProjectIdDropdown', () => { ...@@ -99,6 +101,8 @@ describe('GkeProjectIdDropdown', () => {
hasProject: () => true, hasProject: () => 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({ isLoading: false }); wrapper.setData({ isLoading: false });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
...@@ -110,6 +114,8 @@ describe('GkeProjectIdDropdown', () => { ...@@ -110,6 +114,8 @@ describe('GkeProjectIdDropdown', () => {
bootstrap({ bootstrap({
projects: null, projects: null,
}); });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isLoading: false }); wrapper.setData({ isLoading: false });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
......
...@@ -47,6 +47,8 @@ describe('GkeZoneDropdown', () => { ...@@ -47,6 +47,8 @@ describe('GkeZoneDropdown', () => {
describe('isLoading', () => { describe('isLoading', () => {
beforeEach(() => { 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({ isLoading: true }); wrapper.setData({ isLoading: true });
return wrapper.vm.$nextTick(); return wrapper.vm.$nextTick();
}); });
......
...@@ -63,6 +63,8 @@ describe('ValueStreamMetrics', () => { ...@@ -63,6 +63,8 @@ describe('ValueStreamMetrics', () => {
it('renders hidden GlSingleStat components for each metric', async () => { it('renders hidden GlSingleStat components for each metric', async () => {
await waitForPromises(); await waitForPromises();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isLoading: true }); wrapper.setData({ isLoading: true });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
......
...@@ -26,6 +26,8 @@ describe('Deploy freeze timezone dropdown', () => { ...@@ -26,6 +26,8 @@ describe('Deploy freeze timezone dropdown', () => {
}, },
}); });
// 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 }); wrapper.setData({ searchTerm });
}; };
......
...@@ -117,6 +117,8 @@ describe('Design overlay component', () => { ...@@ -117,6 +117,8 @@ describe('Design overlay component', () => {
it.each([notes[0].discussion.notes.nodes[1], notes[0].discussion.notes.nodes[0]])( it.each([notes[0].discussion.notes.nodes[1], notes[0].discussion.notes.nodes[0]])(
'should not apply inactive class to the pin for the active discussion', 'should not apply inactive class to the pin for the active discussion',
(note) => { (note) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
activeDiscussion: { activeDiscussion: {
id: note.id, id: note.id,
...@@ -131,6 +133,8 @@ describe('Design overlay component', () => { ...@@ -131,6 +133,8 @@ describe('Design overlay component', () => {
); );
it('should apply inactive class to all pins besides the active one', () => { it('should apply inactive class to all pins besides the active one', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
activeDiscussion: { activeDiscussion: {
id: notes[0].id, id: notes[0].id,
...@@ -212,6 +216,8 @@ describe('Design overlay component', () => { ...@@ -212,6 +216,8 @@ describe('Design overlay component', () => {
const { position } = note; const { position } = note;
const newCoordinates = { x: 20, y: 20 }; const newCoordinates = { x: 20, y: 20 };
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
movingNoteNewPosition: { movingNoteNewPosition: {
...position, ...position,
...@@ -345,6 +351,8 @@ describe('Design overlay component', () => { ...@@ -345,6 +351,8 @@ describe('Design overlay component', () => {
}); });
const newCoordinates = { x: 20, y: 20 }; const newCoordinates = { x: 20, y: 20 };
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
movingNoteStartPosition: { movingNoteStartPosition: {
...notes[0].position, ...notes[0].position,
...@@ -368,6 +376,8 @@ describe('Design overlay component', () => { ...@@ -368,6 +376,8 @@ describe('Design overlay component', () => {
it('should calculate delta correctly from state', () => { it('should calculate delta correctly from state', () => {
createComponent(); 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({ wrapper.setData({
movingNoteStartPosition: { movingNoteStartPosition: {
clientX: 10, clientX: 10,
......
...@@ -39,6 +39,8 @@ describe('Design management design presentation component', () => { ...@@ -39,6 +39,8 @@ describe('Design management design presentation component', () => {
stubs, stubs,
}); });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData(data); wrapper.setData(data);
wrapper.element.scrollTo = jest.fn(); wrapper.element.scrollTo = jest.fn();
} }
......
...@@ -9,6 +9,8 @@ describe('Design management large image component', () => { ...@@ -9,6 +9,8 @@ describe('Design management large image component', () => {
wrapper = shallowMount(DesignImage, { wrapper = shallowMount(DesignImage, {
propsData, propsData,
}); });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData(data); wrapper.setData(data);
} }
......
...@@ -42,6 +42,8 @@ describe('Design management pagination component', () => { ...@@ -42,6 +42,8 @@ describe('Design management pagination component', () => {
}); });
it('renders navigation buttons', () => { it('renders navigation buttons', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
designCollection: { designs: [{ id: '1' }, { id: '2' }] }, designCollection: { designs: [{ id: '1' }, { id: '2' }] },
}); });
...@@ -53,6 +55,8 @@ describe('Design management pagination component', () => { ...@@ -53,6 +55,8 @@ describe('Design management pagination component', () => {
describe('keyboard buttons navigation', () => { describe('keyboard buttons navigation', () => {
beforeEach(() => { 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({ wrapper.setData({
designCollection: { designs: [{ filename: '1' }, { filename: '2' }, { filename: '3' }] }, designCollection: { designs: [{ filename: '1' }, { filename: '2' }, { filename: '3' }] },
}); });
......
...@@ -48,6 +48,8 @@ describe('Design management toolbar component', () => { ...@@ -48,6 +48,8 @@ describe('Design management toolbar 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({ wrapper.setData({
permissions: { permissions: {
createDesign, createDesign,
......
...@@ -34,6 +34,8 @@ describe('Design management design version dropdown component', () => { ...@@ -34,6 +34,8 @@ describe('Design management design version dropdown component', () => {
stubs: { GlSprintf }, stubs: { GlSprintf },
}); });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
allVersions: maxVersions > -1 ? mockAllVersions.slice(0, maxVersions) : mockAllVersions, allVersions: maxVersions > -1 ? mockAllVersions.slice(0, maxVersions) : mockAllVersions,
}); });
......
...@@ -317,6 +317,8 @@ describe('Design management design index page', () => { ...@@ -317,6 +317,8 @@ describe('Design management design index page', () => {
describe('when no design exists for given version', () => { describe('when no design exists for given version', () => {
it('redirects to /designs', () => { it('redirects to /designs', () => {
createComponent({ loading: true }); createComponent({ 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({ wrapper.setData({
allVersions: mockAllVersions, allVersions: mockAllVersions,
}); });
......
...@@ -204,6 +204,8 @@ describe('Design management index page', () => { ...@@ -204,6 +204,8 @@ describe('Design management index page', () => {
it('renders error', async () => { it('renders error', async () => {
createComponent(); 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({ error: true }); wrapper.setData({ error: true });
await nextTick(); await nextTick();
...@@ -381,6 +383,8 @@ describe('Design management index page', () => { ...@@ -381,6 +383,8 @@ describe('Design management index page', () => {
it('updates state appropriately after upload complete', async () => { it('updates state appropriately after upload complete', async () => {
createComponent({ stubs: { GlEmptyState } }); createComponent({ stubs: { GlEmptyState } });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ filesToBeSaved: [{ name: 'test' }] }); wrapper.setData({ filesToBeSaved: [{ name: 'test' }] });
wrapper.vm.onUploadDesignDone(designUploadMutationCreatedResponse); wrapper.vm.onUploadDesignDone(designUploadMutationCreatedResponse);
...@@ -393,6 +397,8 @@ describe('Design management index page', () => { ...@@ -393,6 +397,8 @@ describe('Design management index page', () => {
it('updates state appropriately after upload error', async () => { it('updates state appropriately after upload error', async () => {
createComponent({ stubs: { GlEmptyState } }); createComponent({ stubs: { GlEmptyState } });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ filesToBeSaved: [{ name: 'test' }] }); wrapper.setData({ filesToBeSaved: [{ name: 'test' }] });
wrapper.vm.onUploadDesignError(); wrapper.vm.onUploadDesignError();
......
...@@ -26,6 +26,8 @@ describe('Emoji category component', () => { ...@@ -26,6 +26,8 @@ describe('Emoji category component', () => {
}); });
it('renders group', async () => { it('renders group', 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({ renderGroup: true }); await wrapper.setData({ renderGroup: true });
expect(wrapper.find(EmojiGroup).attributes('rendergroup')).toBe('true'); expect(wrapper.find(EmojiGroup).attributes('rendergroup')).toBe('true');
......
...@@ -28,6 +28,8 @@ async function factory(render, propsData = { searchValue: '' }) { ...@@ -28,6 +28,8 @@ async function factory(render, propsData = { searchValue: '' }) {
await nextTick(); await nextTick();
if (render) { if (render) {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ render: true }); wrapper.setData({ render: true });
// Wait for component to render // Wait for component to render
......
...@@ -173,6 +173,8 @@ describe('ErrorDetails', () => { ...@@ -173,6 +173,8 @@ describe('ErrorDetails', () => {
beforeEach(() => { beforeEach(() => {
mocks.$apollo.queries.error.loading = false; mocks.$apollo.queries.error.loading = false;
mountComponent(); mountComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
error: { error: {
id: 'gid://gitlab/Gitlab::ErrorTracking::DetailedError/129381', id: 'gid://gitlab/Gitlab::ErrorTracking::DetailedError/129381',
...@@ -203,6 +205,8 @@ describe('ErrorDetails', () => { ...@@ -203,6 +205,8 @@ describe('ErrorDetails', () => {
const culprit = '<script>console.log("surprise!")</script>'; const culprit = '<script>console.log("surprise!")</script>';
beforeEach(() => { beforeEach(() => {
store.state.details.loadingStacktrace = false; store.state.details.loadingStacktrace = 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({ wrapper.setData({
error: { error: {
culprit, culprit,
...@@ -222,6 +226,8 @@ describe('ErrorDetails', () => { ...@@ -222,6 +226,8 @@ describe('ErrorDetails', () => {
describe('Badges', () => { describe('Badges', () => {
it('should show language and error level badges', () => { it('should show language and error level badges', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
error: { error: {
tags: { level: 'error', logger: 'ruby' }, tags: { level: 'error', logger: 'ruby' },
...@@ -233,6 +239,8 @@ describe('ErrorDetails', () => { ...@@ -233,6 +239,8 @@ describe('ErrorDetails', () => {
}); });
it('should NOT show the badge if the tag is not present', () => { it('should NOT show the badge if the tag is not 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({ wrapper.setData({
error: { error: {
tags: { level: 'error' }, tags: { level: 'error' },
...@@ -246,6 +254,8 @@ describe('ErrorDetails', () => { ...@@ -246,6 +254,8 @@ describe('ErrorDetails', () => {
it.each(Object.keys(severityLevel))( it.each(Object.keys(severityLevel))(
'should set correct severity level variant for %s badge', 'should set correct severity level variant for %s badge',
(level) => { (level) => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
error: { error: {
tags: { level: severityLevel[level] }, tags: { level: severityLevel[level] },
...@@ -260,6 +270,8 @@ describe('ErrorDetails', () => { ...@@ -260,6 +270,8 @@ describe('ErrorDetails', () => {
); );
it('should fallback for ERROR severityLevelVariant when severityLevel is unknown', () => { it('should fallback for ERROR severityLevelVariant when severityLevel is unknown', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
error: { error: {
tags: { level: 'someNewErrorLevel' }, tags: { level: 'someNewErrorLevel' },
...@@ -408,6 +420,8 @@ describe('ErrorDetails', () => { ...@@ -408,6 +420,8 @@ describe('ErrorDetails', () => {
it('should show alert with closed issueId', () => { it('should show alert with closed issueId', () => {
const closedIssueId = 123; const closedIssueId = 123;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
isAlertVisible: true, isAlertVisible: true,
closedIssueId, closedIssueId,
...@@ -429,6 +443,8 @@ describe('ErrorDetails', () => { ...@@ -429,6 +443,8 @@ describe('ErrorDetails', () => {
describe('is present', () => { describe('is present', () => {
beforeEach(() => { 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({ wrapper.setData({
error: { error: {
gitlabIssuePath, gitlabIssuePath,
...@@ -451,6 +467,8 @@ describe('ErrorDetails', () => { ...@@ -451,6 +467,8 @@ describe('ErrorDetails', () => {
describe('is not present', () => { describe('is not present', () => {
beforeEach(() => { 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({ wrapper.setData({
error: { error: {
gitlabIssuePath: null, gitlabIssuePath: null,
...@@ -480,6 +498,8 @@ describe('ErrorDetails', () => { ...@@ -480,6 +498,8 @@ describe('ErrorDetails', () => {
it('should display a link', () => { it('should display a link', () => {
mocks.$apollo.queries.error.loading = false; mocks.$apollo.queries.error.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({ wrapper.setData({
error: { error: {
gitlabCommit, gitlabCommit,
...@@ -493,6 +513,8 @@ describe('ErrorDetails', () => { ...@@ -493,6 +513,8 @@ describe('ErrorDetails', () => {
it('should not display a link', () => { it('should not display a link', () => {
mocks.$apollo.queries.error.loading = false; mocks.$apollo.queries.error.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({ wrapper.setData({
error: { error: {
gitlabCommit: null, gitlabCommit: null,
...@@ -519,6 +541,8 @@ describe('ErrorDetails', () => { ...@@ -519,6 +541,8 @@ describe('ErrorDetails', () => {
it('should display links to Sentry', async () => { it('should display links to Sentry', async () => {
mocks.$apollo.queries.error.loading = false; mocks.$apollo.queries.error.loading = false;
// 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({ await wrapper.setData({
error: { error: {
firstReleaseVersion, firstReleaseVersion,
...@@ -535,6 +559,8 @@ describe('ErrorDetails', () => { ...@@ -535,6 +559,8 @@ describe('ErrorDetails', () => {
it('should display links to GitLab when integrated', async () => { it('should display links to GitLab when integrated', async () => {
mocks.$apollo.queries.error.loading = false; mocks.$apollo.queries.error.loading = false;
// 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({ await wrapper.setData({
error: { error: {
firstReleaseVersion, firstReleaseVersion,
...@@ -557,6 +583,8 @@ describe('ErrorDetails', () => { ...@@ -557,6 +583,8 @@ describe('ErrorDetails', () => {
jest.spyOn(Tracking, 'event'); jest.spyOn(Tracking, 'event');
mocks.$apollo.queries.error.loading = false; mocks.$apollo.queries.error.loading = false;
mountComponent(); mountComponent();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
error: { externalUrl }, error: { externalUrl },
}); });
......
...@@ -396,6 +396,8 @@ describe('ErrorTrackingList', () => { ...@@ -396,6 +396,8 @@ describe('ErrorTrackingList', () => {
GlPagination: false, GlPagination: 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({ pageValue: 2 }); wrapper.setData({ pageValue: 2 });
return wrapper.vm.$nextTick(); return wrapper.vm.$nextTick();
}); });
......
...@@ -73,6 +73,8 @@ describe('IDE clientside preview', () => { ...@@ -73,6 +73,8 @@ describe('IDE clientside preview', () => {
const createInitializedComponent = () => { const createInitializedComponent = () => {
createComponent(); 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({ wrapper.setData({
sandpackReady: true, sandpackReady: true,
manager: { manager: {
...@@ -202,6 +204,8 @@ describe('IDE clientside preview', () => { ...@@ -202,6 +204,8 @@ describe('IDE clientside preview', () => {
it('returns false if loading and mainEntry exists', () => { it('returns false if loading and mainEntry exists', () => {
createComponent({ getters: { packageJson: dummyPackageJson } }); createComponent({ getters: { packageJson: dummyPackageJson } });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ loading: true }); wrapper.setData({ loading: true });
expect(wrapper.vm.showPreview).toBe(false); expect(wrapper.vm.showPreview).toBe(false);
...@@ -209,6 +213,8 @@ describe('IDE clientside preview', () => { ...@@ -209,6 +213,8 @@ describe('IDE clientside preview', () => {
it('returns true if not loading and mainEntry exists', () => { it('returns true if not loading and mainEntry exists', () => {
createComponent({ getters: { packageJson: dummyPackageJson } }); createComponent({ getters: { packageJson: dummyPackageJson } });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ loading: false }); wrapper.setData({ loading: false });
expect(wrapper.vm.showPreview).toBe(true); expect(wrapper.vm.showPreview).toBe(true);
...@@ -218,12 +224,16 @@ describe('IDE clientside preview', () => { ...@@ -218,12 +224,16 @@ describe('IDE clientside preview', () => {
describe('showEmptyState', () => { describe('showEmptyState', () => {
it('returns true if no mainEntry exists', () => { it('returns true if no mainEntry exists', () => {
createComponent(); 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({ loading: false }); wrapper.setData({ loading: false });
expect(wrapper.vm.showEmptyState).toBe(true); expect(wrapper.vm.showEmptyState).toBe(true);
}); });
it('returns false if loading', () => { it('returns false if loading', () => {
createComponent(); 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({ loading: true }); wrapper.setData({ loading: true });
expect(wrapper.vm.showEmptyState).toBe(false); expect(wrapper.vm.showEmptyState).toBe(false);
...@@ -231,6 +241,8 @@ describe('IDE clientside preview', () => { ...@@ -231,6 +241,8 @@ describe('IDE clientside preview', () => {
it('returns false if not loading and mainEntry exists', () => { it('returns false if not loading and mainEntry exists', () => {
createComponent({ getters: { packageJson: dummyPackageJson } }); createComponent({ getters: { packageJson: dummyPackageJson } });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ loading: false }); wrapper.setData({ loading: false });
expect(wrapper.vm.showEmptyState).toBe(false); expect(wrapper.vm.showEmptyState).toBe(false);
...@@ -307,6 +319,8 @@ describe('IDE clientside preview', () => { ...@@ -307,6 +319,8 @@ describe('IDE clientside preview', () => {
describe('update', () => { describe('update', () => {
it('initializes manager if manager is empty', () => { it('initializes manager if manager is empty', () => {
createComponent({ getters: { packageJson: dummyPackageJson } }); createComponent({ getters: { packageJson: dummyPackageJson } });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ sandpackReady: true }); wrapper.setData({ sandpackReady: true });
wrapper.vm.update(); wrapper.vm.update();
...@@ -340,6 +354,8 @@ describe('IDE clientside preview', () => { ...@@ -340,6 +354,8 @@ describe('IDE clientside preview', () => {
describe('template', () => { describe('template', () => {
it('renders ide-preview element when showPreview is true', () => { it('renders ide-preview element when showPreview is true', () => {
createComponent({ getters: { packageJson: dummyPackageJson } }); createComponent({ getters: { packageJson: dummyPackageJson } });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ loading: false }); wrapper.setData({ loading: false });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
...@@ -349,6 +365,8 @@ describe('IDE clientside preview', () => { ...@@ -349,6 +365,8 @@ describe('IDE clientside preview', () => {
it('renders empty state', () => { it('renders empty state', () => {
createComponent(); 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({ loading: false }); wrapper.setData({ loading: false });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
...@@ -360,6 +378,8 @@ describe('IDE clientside preview', () => { ...@@ -360,6 +378,8 @@ describe('IDE clientside preview', () => {
it('renders loading icon', () => { it('renders loading icon', () => {
createComponent(); 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({ loading: true }); wrapper.setData({ loading: true });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
......
...@@ -128,6 +128,8 @@ describe('IDE Terminal', () => { ...@@ -128,6 +128,8 @@ describe('IDE Terminal', () => {
canScrollDown: false, canScrollDown: 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({ canScrollUp: true, canScrollDown: true }); wrapper.setData({ canScrollUp: true, canScrollDown: true });
return nextTick().then(() => { return nextTick().then(() => {
......
...@@ -474,6 +474,8 @@ describe('InviteMembersModal', () => { ...@@ -474,6 +474,8 @@ describe('InviteMembersModal', () => {
beforeEach(() => { beforeEach(() => {
createInviteMembersToGroupWrapper(); createInviteMembersToGroupWrapper();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ newUsersToInvite: [user1] }); wrapper.setData({ newUsersToInvite: [user1] });
}); });
...@@ -644,6 +646,8 @@ describe('InviteMembersModal', () => { ...@@ -644,6 +646,8 @@ describe('InviteMembersModal', () => {
beforeEach(() => { beforeEach(() => {
createInviteMembersToGroupWrapper(); createInviteMembersToGroupWrapper();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ newUsersToInvite: [user3] }); wrapper.setData({ newUsersToInvite: [user3] });
}); });
...@@ -712,6 +716,8 @@ describe('InviteMembersModal', () => { ...@@ -712,6 +716,8 @@ describe('InviteMembersModal', () => {
it('displays the invalid syntax error if one of the emails is invalid', async () => { it('displays the invalid syntax error if one of the emails is invalid', async () => {
createInviteMembersToGroupWrapper(); createInviteMembersToGroupWrapper();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ newUsersToInvite: [user3, user4] }); wrapper.setData({ newUsersToInvite: [user3, user4] });
mockInvitationsApi(httpStatus.CREATED, invitationsApiResponse.ERROR_EMAIL_INVALID); mockInvitationsApi(httpStatus.CREATED, invitationsApiResponse.ERROR_EMAIL_INVALID);
...@@ -787,6 +793,8 @@ describe('InviteMembersModal', () => { ...@@ -787,6 +793,8 @@ describe('InviteMembersModal', () => {
beforeEach(() => { beforeEach(() => {
createInviteMembersToGroupWrapper(); createInviteMembersToGroupWrapper();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ newUsersToInvite: [user1, user3] }); wrapper.setData({ newUsersToInvite: [user1, user3] });
mockInvitationsApi(httpStatus.BAD_REQUEST, invitationsApiResponse.EMAIL_INVALID); mockInvitationsApi(httpStatus.BAD_REQUEST, invitationsApiResponse.EMAIL_INVALID);
...@@ -815,6 +823,8 @@ describe('InviteMembersModal', () => { ...@@ -815,6 +823,8 @@ describe('InviteMembersModal', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ groupToBeSharedWith: sharedGroup }); createComponent({ groupToBeSharedWith: sharedGroup });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ inviteeType: 'group' }); wrapper.setData({ inviteeType: 'group' });
wrapper.vm.$toast = { show: jest.fn() }; wrapper.vm.$toast = { show: jest.fn() };
jest.spyOn(Api, 'groupShareWithGroup').mockResolvedValue({ data: groupPostData }); jest.spyOn(Api, 'groupShareWithGroup').mockResolvedValue({ data: groupPostData });
...@@ -837,6 +847,8 @@ describe('InviteMembersModal', () => { ...@@ -837,6 +847,8 @@ describe('InviteMembersModal', () => {
beforeEach(() => { beforeEach(() => {
createInviteGroupToGroupWrapper(); createInviteGroupToGroupWrapper();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ groupToBeSharedWith: sharedGroup }); wrapper.setData({ groupToBeSharedWith: sharedGroup });
wrapper.vm.$toast = { show: jest.fn() }; wrapper.vm.$toast = { show: jest.fn() };
......
...@@ -169,6 +169,8 @@ describe('RelatedIssuableItem', () => { ...@@ -169,6 +169,8 @@ describe('RelatedIssuableItem', () => {
}); });
it('renders disabled button when removeDisabled', async () => { it('renders disabled button when removeDisabled', 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({ removeDisabled: true }); wrapper.setData({ removeDisabled: true });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
......
...@@ -38,6 +38,8 @@ describe('Issue title suggestions component', () => { ...@@ -38,6 +38,8 @@ describe('Issue title suggestions component', () => {
}); });
it('renders component', () => { it('renders 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(data); wrapper.setData(data);
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
...@@ -47,6 +49,8 @@ describe('Issue title suggestions component', () => { ...@@ -47,6 +49,8 @@ describe('Issue title suggestions component', () => {
it('does not render with empty search', () => { it('does not render with empty search', () => {
wrapper.setProps({ search: '' }); wrapper.setProps({ search: '' });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData(data); wrapper.setData(data);
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
...@@ -55,6 +59,8 @@ describe('Issue title suggestions component', () => { ...@@ -55,6 +59,8 @@ describe('Issue title suggestions component', () => {
}); });
it('does not render when loading', () => { it('does not render when loading', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
...data, ...data,
loading: 1, loading: 1,
...@@ -66,6 +72,8 @@ describe('Issue title suggestions component', () => { ...@@ -66,6 +72,8 @@ describe('Issue title suggestions component', () => {
}); });
it('does not render with empty issues data', () => { it('does not render with empty issues 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({ issues: [] }); wrapper.setData({ issues: [] });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
...@@ -74,6 +82,8 @@ describe('Issue title suggestions component', () => { ...@@ -74,6 +82,8 @@ describe('Issue title suggestions component', () => {
}); });
it('renders list of issues', () => { it('renders list of issues', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData(data); wrapper.setData(data);
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
...@@ -82,6 +92,8 @@ describe('Issue title suggestions component', () => { ...@@ -82,6 +92,8 @@ describe('Issue title suggestions component', () => {
}); });
it('adds margin class to first item', () => { it('adds margin class to first 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(data); wrapper.setData(data);
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
...@@ -90,6 +102,8 @@ describe('Issue title suggestions component', () => { ...@@ -90,6 +102,8 @@ describe('Issue title suggestions component', () => {
}); });
it('does not add margin class to last item', () => { it('does not add margin class to last 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(data); wrapper.setData(data);
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
......
...@@ -114,6 +114,8 @@ describe('Job table app', () => { ...@@ -114,6 +114,8 @@ describe('Job table app', () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
jobs: { jobs: {
pageInfo: { pageInfo: {
......
...@@ -661,6 +661,8 @@ describe('Time series component', () => { ...@@ -661,6 +661,8 @@ describe('Time series component', () => {
const commitUrl = `${mockProjectDir}/-/commit/${mockSha}`; const commitUrl = `${mockProjectDir}/-/commit/${mockSha}`;
beforeEach(() => { 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({ wrapper.setData({
tooltip: { tooltip: {
type: 'deployments', type: 'deployments',
......
...@@ -792,6 +792,8 @@ describe('Dashboard', () => { ...@@ -792,6 +792,8 @@ describe('Dashboard', () => {
}); });
createShallowWrapper({ hasMetrics: true }); createShallowWrapper({ hasMetrics: 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({ hoveredPanel: panelRef }); wrapper.setData({ hoveredPanel: panelRef });
return wrapper.vm.$nextTick(); return wrapper.vm.$nextTick();
......
...@@ -38,6 +38,8 @@ describe('DashboardsDropdown', () => { ...@@ -38,6 +38,8 @@ describe('DashboardsDropdown', () => {
const findSearchInput = () => wrapper.find({ ref: 'monitorDashboardsDropdownSearch' }); const findSearchInput = () => wrapper.find({ ref: 'monitorDashboardsDropdownSearch' });
const findNoItemsMsg = () => wrapper.find({ ref: 'monitorDashboardsDropdownMsg' }); const findNoItemsMsg = () => wrapper.find({ ref: 'monitorDashboardsDropdownMsg' });
const findStarredListDivider = () => wrapper.find({ ref: 'starredListDivider' }); const findStarredListDivider = () => wrapper.find({ ref: 'starredListDivider' });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
const setSearchTerm = (searchTerm) => wrapper.setData({ searchTerm }); const setSearchTerm = (searchTerm) => wrapper.setData({ searchTerm });
beforeEach(() => { beforeEach(() => {
......
...@@ -35,6 +35,8 @@ describe('MR Popover', () => { ...@@ -35,6 +35,8 @@ describe('MR Popover', () => {
describe('loaded state', () => { describe('loaded state', () => {
it('matches the snapshot', () => { it('matches the snapshot', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
mergeRequest: { mergeRequest: {
title: 'Updated Title', title: 'Updated Title',
...@@ -55,6 +57,8 @@ describe('MR Popover', () => { ...@@ -55,6 +57,8 @@ describe('MR Popover', () => {
}); });
it('does not show CI Icon if there is no pipeline data', () => { it('does not show CI Icon if there is no pipeline 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({ wrapper.setData({
mergeRequest: { mergeRequest: {
state: 'opened', state: 'opened',
......
...@@ -263,6 +263,8 @@ describe('issue_comment_form component', () => { ...@@ -263,6 +263,8 @@ describe('issue_comment_form component', () => {
jest.spyOn(wrapper.vm, 'stopPolling'); jest.spyOn(wrapper.vm, 'stopPolling');
jest.spyOn(wrapper.vm, 'saveNote').mockResolvedValue(); jest.spyOn(wrapper.vm, 'saveNote').mockResolvedValue();
// 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({ note: 'hello world' }); await wrapper.setData({ note: 'hello world' });
await findCommentButton().trigger('click'); await findCommentButton().trigger('click');
...@@ -388,6 +390,8 @@ describe('issue_comment_form component', () => { ...@@ -388,6 +390,8 @@ describe('issue_comment_form component', () => {
it('should enable comment button if it has note', async () => { it('should enable comment button if it has note', async () => {
mountComponent(); mountComponent();
// 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({ note: 'Foo' }); await wrapper.setData({ note: 'Foo' });
expect(findCommentTypeDropdown().props('disabled')).toBe(false); expect(findCommentTypeDropdown().props('disabled')).toBe(false);
......
...@@ -257,6 +257,8 @@ describe('issue_note_form component', () => { ...@@ -257,6 +257,8 @@ describe('issue_note_form component', () => {
props = { ...props, ...options }; props = { ...props, ...options };
wrapper = createComponentWrapper(); wrapper = createComponentWrapper();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ isSubmittingWithKeydown: true }); wrapper.setData({ isSubmittingWithKeydown: true });
const textarea = wrapper.find('textarea'); const textarea = wrapper.find('textarea');
......
...@@ -88,6 +88,8 @@ describe('CustomNotificationsModal', () => { ...@@ -88,6 +88,8 @@ describe('CustomNotificationsModal', () => {
beforeEach(async () => { beforeEach(async () => {
wrapper = createComponent(); 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({ wrapper.setData({
events: [ events: [
{ id: 'new_release', enabled: true, name: 'New release', loading: false }, { id: 'new_release', enabled: true, name: 'New release', loading: false },
...@@ -211,6 +213,8 @@ describe('CustomNotificationsModal', () => { ...@@ -211,6 +213,8 @@ describe('CustomNotificationsModal', () => {
wrapper = createComponent({ injectedProperties }); wrapper = createComponent({ injectedProperties });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ wrapper.setData({
events: [ events: [
{ id: 'new_release', enabled: true, name: 'New release', loading: false }, { id: 'new_release', enabled: true, name: 'New release', loading: false },
...@@ -239,6 +243,8 @@ describe('CustomNotificationsModal', () => { ...@@ -239,6 +243,8 @@ describe('CustomNotificationsModal', () => {
mockAxios.onPut('/api/v4/notification_settings').reply(httpStatus.NOT_FOUND, {}); mockAxios.onPut('/api/v4/notification_settings').reply(httpStatus.NOT_FOUND, {});
wrapper = createComponent(); 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({ wrapper.setData({
events: [ events: [
{ id: 'new_release', enabled: true, name: 'New release', loading: false }, { id: 'new_release', enabled: true, name: 'New release', loading: false },
......
...@@ -134,6 +134,8 @@ describe('packages_list', () => { ...@@ -134,6 +134,8 @@ describe('packages_list', () => {
}); });
it('deleteItemConfirmation resets itemToBeDeleted', () => { it('deleteItemConfirmation resets itemToBeDeleted', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ itemToBeDeleted: 1 }); wrapper.setData({ itemToBeDeleted: 1 });
wrapper.vm.deleteItemConfirmation(); wrapper.vm.deleteItemConfirmation();
expect(wrapper.vm.itemToBeDeleted).toEqual(null); expect(wrapper.vm.itemToBeDeleted).toEqual(null);
...@@ -141,6 +143,8 @@ describe('packages_list', () => { ...@@ -141,6 +143,8 @@ describe('packages_list', () => {
it('deleteItemConfirmation emit package:delete', () => { it('deleteItemConfirmation emit package:delete', () => {
const itemToBeDeleted = { id: 2 }; const itemToBeDeleted = { id: 2 };
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ itemToBeDeleted }); wrapper.setData({ itemToBeDeleted });
wrapper.vm.deleteItemConfirmation(); wrapper.vm.deleteItemConfirmation();
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
...@@ -149,6 +153,8 @@ describe('packages_list', () => { ...@@ -149,6 +153,8 @@ describe('packages_list', () => {
}); });
it('deleteItemCanceled resets itemToBeDeleted', () => { it('deleteItemCanceled resets itemToBeDeleted', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ itemToBeDeleted: 1 }); wrapper.setData({ itemToBeDeleted: 1 });
wrapper.vm.deleteItemCanceled(); wrapper.vm.deleteItemCanceled();
expect(wrapper.vm.itemToBeDeleted).toEqual(null); expect(wrapper.vm.itemToBeDeleted).toEqual(null);
...@@ -194,6 +200,8 @@ describe('packages_list', () => { ...@@ -194,6 +200,8 @@ describe('packages_list', () => {
beforeEach(() => { beforeEach(() => {
mountComponent(); mountComponent();
eventSpy = jest.spyOn(Tracking, 'event'); eventSpy = jest.spyOn(Tracking, 'event');
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ itemToBeDeleted: { package_type: 'conan' } }); wrapper.setData({ itemToBeDeleted: { package_type: 'conan' } });
}); });
......
...@@ -79,6 +79,8 @@ describe('UpdateUsername component', () => { ...@@ -79,6 +79,8 @@ describe('UpdateUsername component', () => {
beforeEach(async () => { beforeEach(async () => {
createComponent(); 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({ newUsername }); wrapper.setData({ newUsername });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
......
...@@ -65,6 +65,8 @@ describe('Author Select', () => { ...@@ -65,6 +65,8 @@ describe('Author Select', () => {
describe('user is searching via "filter by commit message"', () => { describe('user is searching via "filter by commit message"', () => {
it('disables dropdown container', () => { it('disables dropdown container', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ hasSearchParam: true }); wrapper.setData({ hasSearchParam: true });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
...@@ -73,6 +75,8 @@ describe('Author Select', () => { ...@@ -73,6 +75,8 @@ describe('Author Select', () => {
}); });
it('has correct tooltip message', () => { it('has correct tooltip message', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ hasSearchParam: true }); wrapper.setData({ hasSearchParam: true });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
...@@ -83,6 +87,8 @@ describe('Author Select', () => { ...@@ -83,6 +87,8 @@ describe('Author Select', () => {
}); });
it('disables dropdown', () => { it('disables dropdown', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ hasSearchParam: false }); wrapper.setData({ hasSearchParam: false });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
...@@ -103,6 +109,8 @@ describe('Author Select', () => { ...@@ -103,6 +109,8 @@ describe('Author Select', () => {
}); });
it('displays the current selected author', () => { it('displays the current selected author', () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ currentAuthor }); wrapper.setData({ currentAuthor });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
...@@ -156,6 +164,8 @@ describe('Author Select', () => { ...@@ -156,6 +164,8 @@ describe('Author Select', () => {
isChecked: true, isChecked: 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({ currentAuthor }); wrapper.setData({ currentAuthor });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
......
...@@ -101,6 +101,8 @@ describe('RevisionDropdown component', () => { ...@@ -101,6 +101,8 @@ describe('RevisionDropdown component', () => {
const findGlDropdownItems = () => wrapper.findAll(GlDropdownItem); const findGlDropdownItems = () => wrapper.findAll(GlDropdownItem);
const findFirstGlDropdownItem = () => findGlDropdownItems().at(0); const findFirstGlDropdownItem = () => findGlDropdownItems().at(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({ branches: ['some-branch'] }); wrapper.setData({ branches: ['some-branch'] });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
......
...@@ -83,6 +83,8 @@ const createComponent = async (mockData = {}, mountFn = shallowMount) => { ...@@ -83,6 +83,8 @@ const createComponent = async (mockData = {}, mountFn = shallowMount) => {
}), }),
); );
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ project, isBinary }); wrapper.setData({ project, isBinary });
await waitForPromises(); await waitForPromises();
......
...@@ -75,6 +75,8 @@ describe('Repository breadcrumbs component', () => { ...@@ -75,6 +75,8 @@ describe('Repository breadcrumbs component', () => {
it('does not render add to tree dropdown when permissions are false', async () => { it('does not render add to tree dropdown when permissions are false', async () => {
factory('/', { canCollaborate: false }); factory('/', { canCollaborate: 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({ userPermissions: { forkProject: false, createMergeRequestIn: false } }); wrapper.setData({ userPermissions: { forkProject: false, createMergeRequestIn: false } });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
...@@ -100,6 +102,8 @@ describe('Repository breadcrumbs component', () => { ...@@ -100,6 +102,8 @@ describe('Repository breadcrumbs component', () => {
it('renders add to tree dropdown when permissions are true', async () => { it('renders add to tree dropdown when permissions are true', async () => {
factory('/', { canCollaborate: true }); factory('/', { canCollaborate: 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({ userPermissions: { forkProject: true, createMergeRequestIn: true } }); wrapper.setData({ userPermissions: { forkProject: true, createMergeRequestIn: true } });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
...@@ -117,6 +121,8 @@ describe('Repository breadcrumbs component', () => { ...@@ -117,6 +121,8 @@ describe('Repository breadcrumbs component', () => {
}); });
it('renders the modal once loaded', async () => { it('renders the modal once loaded', 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({ $apollo: { queries: { userPermissions: { loading: false } } } }); wrapper.setData({ $apollo: { queries: { userPermissions: { loading: false } } } });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
...@@ -139,6 +145,8 @@ describe('Repository breadcrumbs component', () => { ...@@ -139,6 +145,8 @@ describe('Repository breadcrumbs component', () => {
}); });
it('renders the modal once loaded', async () => { it('renders the modal once loaded', 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({ $apollo: { queries: { userPermissions: { loading: false } } } }); wrapper.setData({ $apollo: { queries: { userPermissions: { loading: false } } } });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
......
...@@ -43,6 +43,8 @@ function factory(commit = createCommitData(), loading = false) { ...@@ -43,6 +43,8 @@ function factory(commit = createCommitData(), loading = false) {
}, },
}, },
}); });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm.setData({ commit }); vm.setData({ commit });
vm.vm.$apollo.queries.commit.loading = loading; vm.vm.$apollo.queries.commit.loading = loading;
} }
......
...@@ -34,6 +34,8 @@ describe('Repository file preview component', () => { ...@@ -34,6 +34,8 @@ describe('Repository file preview component', () => {
name: 'README.md', name: 'README.md',
}); });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm.setData({ readme: { html: '<div class="blob">test</div>' } }); vm.setData({ readme: { html: '<div class="blob">test</div>' } });
return vm.vm.$nextTick(() => { return vm.vm.$nextTick(() => {
...@@ -47,6 +49,8 @@ describe('Repository file preview component', () => { ...@@ -47,6 +49,8 @@ describe('Repository file preview component', () => {
name: 'README.md', name: 'README.md',
}); });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm.setData({ readme: { html: '<div class="blob">test</div>' } }); vm.setData({ readme: { html: '<div class="blob">test</div>' } });
return vm.vm return vm.vm
...@@ -63,6 +67,8 @@ describe('Repository file preview component', () => { ...@@ -63,6 +67,8 @@ describe('Repository file preview component', () => {
name: 'README.md', name: 'README.md',
}); });
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm.setData({ loading: 1 }); vm.setData({ loading: 1 });
return vm.vm.$nextTick(() => { return vm.vm.$nextTick(() => {
......
This diff is collapsed.
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