Commit b69f448f authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 66 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 52907ac2
......@@ -4,7 +4,7 @@ import axios from '~/lib/utils/axios_utils';
import refreshCounts from '~/pages/search/show/refresh_counts';
const URL = `${TEST_HOST}/search/count?search=lorem+ipsum&project_id=3`;
const urlWithScope = scope => `${URL}&scope=${scope}`;
const urlWithScope = (scope) => `${URL}&scope=${scope}`;
const counts = [
{ scope: 'issues', count: 4 },
{ scope: 'merge_requests', count: 5 },
......
......@@ -2,7 +2,7 @@ import $ from 'jquery';
import preserveUrlFragment from '~/pages/sessions/new/preserve_url_fragment';
describe('preserve_url_fragment', () => {
const findFormAction = selector => {
const findFormAction = (selector) => {
return $(`.omniauth-container ${selector}`).parent('form').attr('action');
};
......
......@@ -56,7 +56,7 @@ describe('SigninTabsMemoizer', () => {
};
jest
.spyOn(document, 'querySelector')
.mockImplementation(selector =>
.mockImplementation((selector) =>
selector === `${tabSelector} a[href="#bogus"]` ? null : fakeTab,
);
......
......@@ -14,7 +14,7 @@ const Component = Vue.extend(PDFLab);
describe('PDF component', () => {
let vm;
const checkLoaded = done => {
const checkLoaded = (done) => {
if (vm.loading) {
setTimeout(() => {
checkLoaded(done);
......@@ -25,7 +25,7 @@ describe('PDF component', () => {
};
describe('without PDF data', () => {
beforeEach(done => {
beforeEach((done) => {
vm = new Component({
propsData: {
pdf: '',
......@@ -43,7 +43,7 @@ describe('PDF component', () => {
});
describe('with PDF data', () => {
beforeEach(done => {
beforeEach((done) => {
vm = new Component({
propsData: {
pdf,
......
......@@ -14,7 +14,7 @@ describe('Page component', () => {
vm.$destroy();
});
it('renders the page when mounting', done => {
it('renders the page when mounting', (done) => {
const promise = Promise.resolve();
const testPage = {
render: jest.fn().mockReturnValue({ promise: Promise.resolve() }),
......
......@@ -7,7 +7,7 @@ import RequestWarning from '~/performance_bar/components/request_warning.vue';
describe('detailedMetric', () => {
let wrapper;
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(DetailedMetric, {
propsData: {
...props,
......@@ -16,9 +16,9 @@ describe('detailedMetric', () => {
};
const findAllTraceBlocks = () => wrapper.findAll('pre');
const findTraceBlockAtIndex = index => findAllTraceBlocks().at(index);
const findTraceBlockAtIndex = (index) => findAllTraceBlocks().at(index);
const findExpandBacktraceBtns = () => wrapper.findAll('[data-testid="backtrace-expand-btn"]');
const findExpandedBacktraceBtnAtIndex = index => findExpandBacktraceBtns().at(index);
const findExpandedBacktraceBtnAtIndex = (index) => findExpandBacktraceBtns().at(index);
afterEach(() => {
wrapper.destroy();
......@@ -95,7 +95,7 @@ describe('detailedMetric', () => {
expect(wrapper.find('.js-toggle-button')).not.toBeNull();
wrapper.findAll('.performance-bar-modal td:nth-child(2)').wrappers.forEach(request => {
wrapper.findAll('.performance-bar-modal td:nth-child(2)').wrappers.forEach((request) => {
expect(request.text()).toContain('world');
});
});
......
......@@ -3,7 +3,7 @@ import PerformanceBarStore from '~/performance_bar/stores/performance_bar_store'
describe('PerformanceBarStore', () => {
describe('truncateUrl', () => {
let store;
const findUrl = id => store.findRequest(id).truncatedUrl;
const findUrl = (id) => store.findRequest(id).truncatedUrl;
beforeEach(() => {
store = new PerformanceBarStore();
......
......@@ -5,7 +5,7 @@ import { CI_CONFIG_STATUS_INVALID } from '~/pipeline_editor/constants';
import { mockCiConfigQueryResponse, mockLintHelpPagePath } from '../../mock_data';
import { unwrapStagesWithNeeds } from '~/pipelines/components/unwrapping_utils';
const getCiConfig = mergedConfig => {
const getCiConfig = (mergedConfig) => {
const { ciConfig } = mockCiConfigQueryResponse.data;
return {
...ciConfig,
......@@ -29,10 +29,10 @@ describe('~/pipeline_editor/components/lint/ci_lint.vue', () => {
});
};
const findAllByTestId = selector => wrapper.findAll(`[data-testid="${selector}"]`);
const findAllByTestId = (selector) => wrapper.findAll(`[data-testid="${selector}"]`);
const findAlert = () => wrapper.find(GlAlert);
const findLintParameters = () => findAllByTestId('ci-lint-parameter');
const findLintParameterAt = i => findLintParameters().at(i);
const findLintParameterAt = (i) => findLintParameters().at(i);
afterEach(() => {
wrapper.destroy();
......
......@@ -139,7 +139,7 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => {
const findLoadingIcon = () => wrapper.find(GlLoadingIcon);
const findAlert = () => wrapper.find(GlAlert);
const findTabAt = i => wrapper.findAll(GlTab).at(i);
const findTabAt = (i) => wrapper.findAll(GlTab).at(i);
const findVisualizationTab = () => wrapper.find('[data-testid="visualization-tab"]');
const findTextEditor = () => wrapper.find(TextEditor);
const findEditorLite = () => wrapper.find(MockEditorLite);
......@@ -255,7 +255,7 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => {
startBranch: mockDefaultBranch,
};
const findInForm = selector => findCommitForm().find(selector);
const findInForm = (selector) => findCommitForm().find(selector);
const submitCommit = async ({
message = mockCommitMessage,
......
......@@ -44,7 +44,7 @@ describe('Pipeline New Form', () => {
const findWarnings = () => wrapper.findAll('[data-testid="run-pipeline-warning"]');
const findLoadingIcon = () => wrapper.find(GlLoadingIcon);
const getExpectedPostParams = () => JSON.parse(mock.history.post[0].data);
const changeRef = i => findDropdownItems().at(i).vm.$emit('click');
const changeRef = (i) => findDropdownItems().at(i).vm.$emit('click');
const createComponent = (term = '', props = {}, method = shallowMount) => {
wrapper = method(PipelineNewForm, {
......
......@@ -94,7 +94,7 @@ describe('The DAG graph', () => {
});
describe('interactions', () => {
const strokeOpacity = opacity => `stroke-opacity: ${opacity};`;
const strokeOpacity = (opacity) => `stroke-opacity: ${opacity};`;
const baseOpacity = () => wrapper.vm.$options.viewOptions.baseOpacity;
describe('links', () => {
......@@ -164,10 +164,10 @@ describe('The DAG graph', () => {
describe('nodes', () => {
const liveNode = () => getAllNodes().at(10);
const anotherLiveNode = () => getAllNodes().at(5);
const nodesNotHighlighted = () => getAllNodes().filter(n => !n.classes(IS_HIGHLIGHTED));
const linksNotHighlighted = () => getAllLinks().filter(n => !n.classes(IS_HIGHLIGHTED));
const nodesHighlighted = () => getAllNodes().filter(n => n.classes(IS_HIGHLIGHTED));
const linksHighlighted = () => getAllLinks().filter(n => n.classes(IS_HIGHLIGHTED));
const nodesNotHighlighted = () => getAllNodes().filter((n) => !n.classes(IS_HIGHLIGHTED));
const linksNotHighlighted = () => getAllLinks().filter((n) => !n.classes(IS_HIGHLIGHTED));
const nodesHighlighted = () => getAllNodes().filter((n) => n.classes(IS_HIGHLIGHTED));
const linksHighlighted = () => getAllLinks().filter((n) => n.classes(IS_HIGHLIGHTED));
describe('on click', () => {
it('highlights the clicked node and predecessors', () => {
......@@ -176,19 +176,19 @@ describe('The DAG graph', () => {
expect(nodesNotHighlighted().length < getAllNodes().length).toBe(true);
expect(linksNotHighlighted().length < getAllLinks().length).toBe(true);
linksHighlighted().wrappers.forEach(link => {
linksHighlighted().wrappers.forEach((link) => {
expect(link.attributes('style')).toBe(strokeOpacity(highlightIn));
});
nodesHighlighted().wrappers.forEach(node => {
nodesHighlighted().wrappers.forEach((node) => {
expect(node.attributes('stroke')).not.toBe('#f2f2f2');
});
linksNotHighlighted().wrappers.forEach(link => {
linksNotHighlighted().wrappers.forEach((link) => {
expect(link.attributes('style')).toBe(strokeOpacity(highlightOut));
});
nodesNotHighlighted().wrappers.forEach(node => {
nodesNotHighlighted().wrappers.forEach((node) => {
expect(node.attributes('stroke')).toBe('#f2f2f2');
});
});
......
......@@ -21,7 +21,7 @@ describe('Pipeline DAG graph wrapper', () => {
const getAllAlerts = () => wrapper.findAll(GlAlert);
const getGraph = () => wrapper.find(DagGraph);
const getNotes = () => wrapper.find(DagAnnotations);
const getErrorText = type => wrapper.vm.$options.errorTexts[type];
const getErrorText = (type) => wrapper.vm.$options.errorTexts[type];
const getEmptyState = () => wrapper.find(GlEmptyState);
const createComponent = ({
......
......@@ -11,10 +11,10 @@ describe('Pipelines filtered search', () => {
let mock;
const findFilteredSearch = () => wrapper.find(GlFilteredSearch);
const getSearchToken = type =>
const getSearchToken = (type) =>
findFilteredSearch()
.props('availableTokens')
.find(token => token.type === type);
.find((token) => token.type === type);
const findBranchToken = () => getSearchToken('ref');
const findTagToken = () => getSearchToken('tag');
const findUserToken = () => getSearchToken('username');
......
......@@ -33,7 +33,7 @@ describe('pipeline graph action component', () => {
expect(wrapper.attributes('title')).toBe('bar');
});
it('should update bootstrap tooltip when title changes', done => {
it('should update bootstrap tooltip when title changes', (done) => {
wrapper.setProps({ tooltipText: 'changed' });
wrapper.vm
......@@ -51,7 +51,7 @@ describe('pipeline graph action component', () => {
});
describe('on click', () => {
it('emits `pipelineActionRequestComplete` after a successful request', done => {
it('emits `pipelineActionRequestComplete` after a successful request', (done) => {
jest.spyOn(wrapper.vm, '$emit');
findButton().trigger('click');
......@@ -64,7 +64,7 @@ describe('pipeline graph action component', () => {
.catch(done.fail);
});
it('renders a loading icon while waiting for request', done => {
it('renders a loading icon while waiting for request', (done) => {
findButton().trigger('click');
wrapper.vm.$nextTick(() => {
......
......@@ -18,7 +18,7 @@ describe('graph component', () => {
const findExpandPipelineBtn = () => wrapper.find('[data-testid="expand-pipeline-button"]');
const findAllExpandPipelineBtns = () => wrapper.findAll('[data-testid="expand-pipeline-button"]');
const findStageColumns = () => wrapper.findAll(StageColumnComponentLegacy);
const findStageColumnAt = i => findStageColumns().at(i);
const findStageColumnAt = (i) => findStageColumns().at(i);
beforeEach(() => {
mediator = new PipelinesMediator({ endpoint: '' });
......@@ -167,7 +167,7 @@ describe('graph component', () => {
});
describe('with expanded pipeline', () => {
it('should render expanded pipeline', done => {
it('should render expanded pipeline', (done) => {
// expand the pipeline
store.state.pipeline.triggered_by[0].isExpanded = true;
......@@ -212,7 +212,7 @@ describe('graph component', () => {
});
describe('with expanded pipeline', () => {
it('should render expanded pipeline', done => {
it('should render expanded pipeline', (done) => {
// expand the pipeline
store.state.pipeline.triggered[0].isExpanded = true;
......
......@@ -7,7 +7,7 @@ describe('pipeline graph job item', () => {
const findJobWithoutLink = () => wrapper.find('[data-testid="job-without-link"]');
const findJobWithLink = () => wrapper.find('[data-testid="job-with-link"]');
const createWrapper = propsData => {
const createWrapper = (propsData) => {
wrapper = mount(JobItem, {
propsData,
});
......@@ -52,7 +52,7 @@ describe('pipeline graph job item', () => {
});
describe('name with link', () => {
it('should render the job name and status with a link', done => {
it('should render the job name and status with a link', (done) => {
createWrapper({ job: mockJob });
wrapper.vm.$nextTick(() => {
......
......@@ -656,7 +656,7 @@ export const wrappedPipelineReturn = {
export const generateResponse = (raw, mockPath) => unwrapPipelineData(mockPath, raw.data);
export const pipelineWithUpstreamDownstream = base => {
export const pipelineWithUpstreamDownstream = (base) => {
const pip = { ...base };
pip.data.project.pipeline.downstream = downstream;
pip.data.project.pipeline.upstream = upstream;
......
......@@ -23,7 +23,7 @@ describe('pipeline graph component', () => {
const findAlert = () => wrapper.find(GlAlert);
const findAllStagePills = () => wrapper.findAll(StagePill);
const findAllStageBackgroundElements = () => wrapper.findAll('[data-testid="stage-background"]');
const findStageBackgroundElementAt = index => findAllStageBackgroundElements().at(index);
const findStageBackgroundElementAt = (index) => findAllStageBackgroundElements().at(index);
const findAllJobPills = () => wrapper.findAll(JobPill);
afterEach(() => {
......
......@@ -28,7 +28,7 @@ describe('Pipeline Url Component', () => {
pipelineScheduleUrl: 'foo',
};
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(PipelineUrlComponent, {
propsData: { ...defaultProps, ...props },
provide: {
......
......@@ -57,10 +57,10 @@ describe('Pipelines', () => {
};
const findFilteredSearch = () => wrapper.find(GlFilteredSearch);
const findByTestId = id => wrapper.find(`[data-testid="${id}"]`);
const findByTestId = (id) => wrapper.find(`[data-testid="${id}"]`);
const findNavigationTabs = () => wrapper.find(NavigationTabs);
const findNavigationControls = () => wrapper.find(NavigationControls);
const findTab = tab => findByTestId(`pipelines-tab-${tab}`);
const findTab = (tab) => findByTestId(`pipelines-tab-${tab}`);
const findRunPipelineButton = () => findByTestId('run-pipeline-button');
const findCiLintButton = () => findByTestId('ci-lint-button');
......
......@@ -5,7 +5,7 @@ import eventHub from '~/pipelines/event_hub';
describe('Pipelines Table Row', () => {
const jsonFixtureName = 'pipelines/pipelines.json';
const createWrapper = pipeline =>
const createWrapper = (pipeline) =>
mount(PipelinesTableRowComponent, {
propsData: {
pipeline,
......@@ -24,9 +24,9 @@ describe('Pipelines Table Row', () => {
beforeEach(() => {
const { pipelines } = getJSONFixture(jsonFixtureName);
pipeline = pipelines.find(p => p.user !== null && p.commit !== null);
pipelineWithoutAuthor = pipelines.find(p => p.user === null && p.commit !== null);
pipelineWithoutCommit = pipelines.find(p => p.user === null && p.commit === null);
pipeline = pipelines.find((p) => p.user !== null && p.commit !== null);
pipelineWithoutAuthor = pipelines.find((p) => p.user === null && p.commit !== null);
pipelineWithoutCommit = pipelines.find((p) => p.user === null && p.commit === null);
});
afterEach(() => {
......@@ -187,7 +187,7 @@ describe('Pipelines Table Row', () => {
});
it('emits `retryPipeline` event when retry button is clicked and toggles loading', () => {
eventHub.$on('retryPipeline', endpoint => {
eventHub.$on('retryPipeline', (endpoint) => {
expect(endpoint).toBe('/retry');
});
......@@ -196,7 +196,7 @@ describe('Pipelines Table Row', () => {
});
it('emits `openConfirmationModal` event when cancel button is clicked and toggles loading', () => {
eventHub.$once('openConfirmationModal', data => {
eventHub.$once('openConfirmationModal', (data) => {
const { id, ref, commit } = pipeline;
expect(data.endpoint).toBe('/cancel');
......@@ -212,7 +212,7 @@ describe('Pipelines Table Row', () => {
wrapper.find('.js-pipelines-cancel-button').trigger('click');
});
it('renders a loading icon when `cancelingPipeline` matches pipeline id', done => {
it('renders a loading icon when `cancelingPipeline` matches pipeline id', (done) => {
wrapper.setProps({ cancelingPipeline: pipeline.id });
wrapper.vm
.$nextTick()
......
......@@ -24,7 +24,7 @@ describe('Pipelines Table', () => {
beforeEach(() => {
const { pipelines } = getJSONFixture(jsonFixtureName);
pipeline = pipelines.find(p => p.user !== null && p.commit !== null);
pipeline = pipelines.find((p) => p.user !== null && p.commit !== null);
createComponent();
});
......
......@@ -32,14 +32,14 @@ describe('EE Pipeline store', () => {
describe('triggered', () => {
it('adds isExpanding & isLoading keys set to false for each triggered pipeline', () => {
store.state.pipeline.triggered.forEach(pipeline => {
store.state.pipeline.triggered.forEach((pipeline) => {
expect(pipeline.isExpanded).toEqual(false);
expect(pipeline.isLoading).toEqual(false);
});
});
it('parses nested triggered pipelines', () => {
store.state.pipeline.triggered[1].triggered.forEach(pipeline => {
store.state.pipeline.triggered[1].triggered.forEach((pipeline) => {
expect(pipeline.isExpanded).toEqual(false);
expect(pipeline.isLoading).toEqual(false);
});
......
......@@ -39,7 +39,7 @@ describe('Actions TestReports Store', () => {
mock.onGet(summaryEndpoint).replyOnce(200, summary, {});
});
it('sets testReports and shows tests', done => {
it('sets testReports and shows tests', (done) => {
testAction(
actions.fetchSummary,
null,
......@@ -50,7 +50,7 @@ describe('Actions TestReports Store', () => {
);
});
it('should create flash on API error', done => {
it('should create flash on API error', (done) => {
testAction(
actions.fetchSummary,
null,
......@@ -75,7 +75,7 @@ describe('Actions TestReports Store', () => {
.replyOnce(200, testReports.test_suites[0], {});
});
it('sets test suite and shows tests', done => {
it('sets test suite and shows tests', (done) => {
const suite = testReports.test_suites[0];
const index = 0;
......@@ -89,7 +89,7 @@ describe('Actions TestReports Store', () => {
);
});
it('should create flash on API error', done => {
it('should create flash on API error', (done) => {
const index = 0;
testAction(
......@@ -106,7 +106,7 @@ describe('Actions TestReports Store', () => {
});
describe('when we already have the suite data', () => {
it('should not fetch suite', done => {
it('should not fetch suite', (done) => {
const index = 0;
testReports.test_suites[0].hasFullSuite = true;
......@@ -116,7 +116,7 @@ describe('Actions TestReports Store', () => {
});
describe('set selected suite index', () => {
it('sets selectedSuiteIndex', done => {
it('sets selectedSuiteIndex', (done) => {
const selectedSuiteIndex = 0;
testAction(
......@@ -131,7 +131,7 @@ describe('Actions TestReports Store', () => {
});
describe('remove selected suite index', () => {
it('sets selectedSuiteIndex to null', done => {
it('sets selectedSuiteIndex to null', (done) => {
testAction(
actions.removeSelectedSuiteIndex,
{},
......@@ -144,11 +144,11 @@ describe('Actions TestReports Store', () => {
});
describe('toggles loading', () => {
it('sets isLoading to true', done => {
it('sets isLoading to true', (done) => {
testAction(actions.toggleLoading, {}, state, [{ type: types.TOGGLE_LOADING }], [], done);
});
it('toggles isLoading to false', done => {
it('toggles isLoading to false', (done) => {
testAction(
actions.toggleLoading,
{},
......
......@@ -40,7 +40,7 @@ describe('Getters TestReports Store', () => {
setupState();
const suites = getters.getTestSuites(state);
const expected = testReports.test_suites.map(x => ({
const expected = testReports.test_suites.map((x) => ({
...x,
formattedTime: formattedTime(x.total_time),
}));
......@@ -72,7 +72,7 @@ describe('Getters TestReports Store', () => {
const cases = getters.getSuiteTests(state);
const expected = testReports.test_suites[0].test_cases
.map(x => ({
.map((x) => ({
...x,
formattedTime: formattedTime(x.execution_time),
icon: iconForTestStatus(x.status),
......
......@@ -23,7 +23,7 @@ describe('Test reports suite table', () => {
const noCasesMessage = () => wrapper.find('.js-no-test-cases');
const allCaseRows = () => wrapper.findAll('.js-case-row');
const findCaseRowAtIndex = index => wrapper.findAll('.js-case-row').at(index);
const findCaseRowAtIndex = (index) => wrapper.findAll('.js-case-row').at(index);
const findIconForRow = (row, status) => row.find(`.ci-status-icon-${status}`);
const createComponent = (suite = testSuite, perPage = 20) => {
......@@ -73,8 +73,8 @@ describe('Test reports suite table', () => {
TestStatus.SKIPPED,
TestStatus.SUCCESS,
'unknown',
])('renders the correct icon for test case with %s status', status => {
const test = testCases.findIndex(x => x.status === status);
])('renders the correct icon for test case with %s status', (status) => {
const test = testCases.findIndex((x) => x.status === status);
const row = findCaseRowAtIndex(test);
expect(findIconForRow(row, status).exists()).toBe(true);
......
......@@ -22,7 +22,7 @@ describe('Test reports summary', () => {
showBack: false,
};
const createComponent = props => {
const createComponent = (props) => {
wrapper = mount(Summary, {
propsData: {
...defaultProps,
......
......@@ -26,7 +26,7 @@ describe('Pipeline Trigger Author Token', () => {
},
};
const createComponent = data => {
const createComponent = (data) => {
wrapper = shallowMount(PipelineTriggerAuthorToken, {
propsData: {
...defaultProps,
......
......@@ -89,7 +89,7 @@ const completeMock = [
{
...basicStageInfo,
groups: {
nodes: groupsArray.map(group => ({ ...group, jobs: { nodes: jobArrayWithNeeds } })),
nodes: groupsArray.map((group) => ({ ...group, jobs: { nodes: jobArrayWithNeeds } })),
},
},
];
......
......@@ -56,7 +56,7 @@ describe('DeleteAccountModal component', () => {
const findModal = () => wrapper.find(GlModalStub);
describe('with password confirmation', () => {
beforeEach(done => {
beforeEach((done) => {
createWrapper({
propsData: {
confirmWithPassword: true,
......@@ -68,7 +68,7 @@ describe('DeleteAccountModal component', () => {
Vue.nextTick().then(done).catch(done.fail);
});
it('does not accept empty password', done => {
it('does not accept empty password', (done) => {
const { form, input } = findElements();
jest.spyOn(form, 'submit').mockImplementation(() => {});
input.value = '';
......@@ -86,7 +86,7 @@ describe('DeleteAccountModal component', () => {
.catch(done.fail);
});
it('submits form with password', done => {
it('submits form with password', (done) => {
const { form, input } = findElements();
jest.spyOn(form, 'submit').mockImplementation(() => {});
input.value = 'anything';
......@@ -106,7 +106,7 @@ describe('DeleteAccountModal component', () => {
});
describe('with username confirmation', () => {
beforeEach(done => {
beforeEach((done) => {
createWrapper({
propsData: {
confirmWithPassword: false,
......@@ -118,7 +118,7 @@ describe('DeleteAccountModal component', () => {
Vue.nextTick().then(done).catch(done.fail);
});
it('does not accept wrong username', done => {
it('does not accept wrong username', (done) => {
const { form, input } = findElements();
jest.spyOn(form, 'submit').mockImplementation(() => {});
input.value = 'this is wrong';
......@@ -136,7 +136,7 @@ describe('DeleteAccountModal component', () => {
.catch(done.fail);
});
it('submits form with correct username', done => {
it('submits form with correct username', (done) => {
const { form, input } = findElements();
jest.spyOn(form, 'submit').mockImplementation(() => {});
input.value = username;
......
......@@ -7,7 +7,7 @@ import axios from '~/lib/utils/axios_utils';
jest.mock('~/lib/dompurify', () => ({
addHook: jest.fn(),
sanitize: jest.fn(val => val),
sanitize: jest.fn((val) => val),
}));
const BLOB_URL_TEMPLATE = `${TEST_HOST}/namespace/project/blob/master`;
......@@ -39,7 +39,7 @@ describe('ProjectFindFile', () => {
element
.find('.tree-table tr')
.toArray()
.map(el => ({
.map((el) => ({
text: el.textContent,
href: el.querySelector('a').href,
}));
......@@ -53,14 +53,14 @@ describe('ProjectFindFile', () => {
{ path: 'folde?rC/fil#F.txt', escaped: 'folde%3FrC/fil%23F.txt' },
];
beforeEach(done => {
beforeEach((done) => {
// Create a mock adapter for stubbing axios API requests
mock = new MockAdapter(axios);
element = $(TEMPLATE);
mock.onGet(FILE_FIND_URL).replyOnce(
200,
files.map(x => x.path),
files.map((x) => x.path),
);
getProjectFindFileInstance(); // This triggers a load / axios call + subsequent render in the constructor
......
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