Commit 12ec2681 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'migrate-pipeline-medatior-spec' into 'master'

Migrate pipelines mediator spec to jest

See merge request gitlab-org/gitlab!30997
parents 6765c93f 2ab99457
import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
import PipelineMediator from '~/pipelines/pipeline_details_mediator';
import waitForPromises from 'helpers/wait_for_promises';
describe('PipelineMdediator', () => {
let mediator;
......@@ -23,14 +24,13 @@ describe('PipelineMdediator', () => {
});
describe('request and store data', () => {
it('should store received data', done => {
it('should store received data', () => {
mock.onGet('foo.json').reply(200, { id: '121123' });
mediator.fetchPipeline();
setTimeout(() => {
return waitForPromises().then(() => {
expect(mediator.store.state.pipeline).toEqual({ id: '121123' });
done();
}, 0);
});
});
});
});
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