Skip to content

Commit

Permalink
fix: try just 5 workers on test (#879)
Browse files Browse the repository at this point in the history
Co-authored-by: Lee Chase <[email protected]>
  • Loading branch information
lee-chase and lee-chase authored Apr 28, 2020
1 parent 119cda1 commit aa03ee1
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 102 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "yarn build:packages; yarn build:storybook",
"build:packages": "lerna exec yarn build --no-prefix --concurrency 1",
"build:storybook": "yarn info @carbon/vue --json > package-info.jsonl; vue-cli-service storybook:build -c storybook/.storybook -o storybook/storybook-static",
"ci-check": "yarn format:diff && yarn test && yarn build:packages && yarn build:storybook --quiet",
"ci-check": "yarn format:diff && yarn test --maxWorkers=5 && yarn build:packages && yarn build:storybook --quiet",
"clean": "lerna run clean; rimraf storybook/storybook-static package-info.jsonl node_modules/.cache",
"format": "prettier --write '**/*.{scss,css,js,md,vue}' '!**/{build,es,lib,storybook,ts,umd}/**'",
"format:diff": "prettier --list-different '**/*.{scss,css,js,md,vue}' '!**/{dist,storybook-static}/**'",
Expand Down
202 changes: 101 additions & 101 deletions packages/core/__tests__/cv-loading.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,105 +84,105 @@ describe('CvLoading', () => {
// ***************
// FUNCTIONAL TESTS
// ***************
// it('should compute loading radius correctly', async () => {
// const propsData = { small: false };
// const wrapper = await shallow(CvLoading, {
// propsData,
// });
// expect(wrapper.vm.loadingRadius).toEqual(RADIUS_NORMAL);
// });

// it('should compute small loading radius correctly', async () => {
// const propsData = { small: true };
// const wrapper = await shallow(CvLoading, {
// propsData,
// });
// expect(wrapper.vm.loadingRadius).toEqual(RADIUS_SMALL);
// });

// it('should compute `overlayClasses` correctly when overlay is not used', async () => {
// const propsData = { overlay: false };
// const wrapper = await shallow(CvLoading, {
// propsData,
// });
// expect(wrapper.vm.overlayClasses).toEqual([]);
// });

// it('should compute `overlayClasses` correctly when overlayed and active', async () => {
// const propsData = { overlay: true, active: true };
// const wrapper = await shallow(CvLoading, {
// propsData,
// });
// expect(wrapper.vm.overlayClasses).toEqual([loadingOverlayClass]);
// });

// it('should compute `overlayClasses` correctly when overlayed and stopping', async () => {
// const propsData = { overlay: true, active: true };
// const wrapper = await shallow(CvLoading, {
// propsData,
// });
// expect(wrapper.vm.overlayClasses).toEqual([loadingOverlayClass]);
// });

// it('should compute `overlayClasses` correctly when overlayed and not active or stopped', async () => {
// const propsData = { overlay: true, active: false };
// const wrapper = await shallow(CvLoading, {
// propsData,
// });
// wrapper.setData({
// stopping: false,
// });
// expect(wrapper.vm.overlayClasses).toEqual([loadingOverlayStopClass]);
// });

// it('animation should be stopped once `active` prop is set to false', async () => {
// const propsData = { active: true };
// const wrapper = await mount(CvLoading, {
// propsData,
// });
// expect(wrapper.vm.stopping).toEqual(false);

// await setProps(wrapper, {
// active: false,
// });
// expect(wrapper.vm.stopping).toEqual(true);
// await trigger(wrapper, 'animationend', { animationName: 'rotate-end-p2' });
// expect(wrapper.vm.stopping).toEqual(false);
// });

// it('animation should be continued once `active` prop is set to true again', async () => {
// const propsData = { active: false };
// const wrapper = await mount(CvLoading, {
// propsData,
// });

// await setProps(wrapper, {
// active: true,
// });
// expect(wrapper.vm.stopping).toEqual(false);
// });

// it('should emit `loading-end` when animation `rotate-end-p2` stops', async () => {
// const propsData = { active: true };
// const wrapper = await mount(CvLoading, {
// propsData,
// });
// await setProps(wrapper, {
// active: false,
// });
// await trigger(wrapper, 'animationend', { animationName: 'rotate-end-p2' });
// expect(wrapper.emitted()['loading-end']).toBeTruthy();
// });

// it('should not emit `loading-end` when animation with the name differed from `rotate-end-p2` stops', async () => {
// const propsData = { active: true };
// const wrapper = await mount(CvLoading, {
// propsData,
// });
// await setProps(wrapper, {
// active: false,
// });
// await trigger(wrapper, 'animationend', { animationName: 'not-rotate-end-p2' });
// expect(wrapper.emitted()['loading-end']).toBeFalsy();
// });
it('should compute loading radius correctly', async () => {
const propsData = { small: false };
const wrapper = await shallow(CvLoading, {
propsData,
});
expect(wrapper.vm.loadingRadius).toEqual(RADIUS_NORMAL);
});

it('should compute small loading radius correctly', async () => {
const propsData = { small: true };
const wrapper = await shallow(CvLoading, {
propsData,
});
expect(wrapper.vm.loadingRadius).toEqual(RADIUS_SMALL);
});

it('should compute `overlayClasses` correctly when overlay is not used', async () => {
const propsData = { overlay: false };
const wrapper = await shallow(CvLoading, {
propsData,
});
expect(wrapper.vm.overlayClasses).toEqual([]);
});

it('should compute `overlayClasses` correctly when overlayed and active', async () => {
const propsData = { overlay: true, active: true };
const wrapper = await shallow(CvLoading, {
propsData,
});
expect(wrapper.vm.overlayClasses).toEqual([loadingOverlayClass]);
});

it('should compute `overlayClasses` correctly when overlayed and stopping', async () => {
const propsData = { overlay: true, active: true };
const wrapper = await shallow(CvLoading, {
propsData,
});
expect(wrapper.vm.overlayClasses).toEqual([loadingOverlayClass]);
});

it('should compute `overlayClasses` correctly when overlayed and not active or stopped', async () => {
const propsData = { overlay: true, active: false };
const wrapper = await shallow(CvLoading, {
propsData,
});
wrapper.setData({
stopping: false,
});
expect(wrapper.vm.overlayClasses).toEqual([loadingOverlayStopClass]);
});

it('animation should be stopped once `active` prop is set to false', async () => {
const propsData = { active: true };
const wrapper = await mount(CvLoading, {
propsData,
});
expect(wrapper.vm.stopping).toEqual(false);

await setProps(wrapper, {
active: false,
});
expect(wrapper.vm.stopping).toEqual(true);
await trigger(wrapper, 'animationend', { animationName: 'rotate-end-p2' });
expect(wrapper.vm.stopping).toEqual(false);
});

it('animation should be continued once `active` prop is set to true again', async () => {
const propsData = { active: false };
const wrapper = await mount(CvLoading, {
propsData,
});

await setProps(wrapper, {
active: true,
});
expect(wrapper.vm.stopping).toEqual(false);
});

it('should emit `loading-end` when animation `rotate-end-p2` stops', async () => {
const propsData = { active: true };
const wrapper = await mount(CvLoading, {
propsData,
});
await setProps(wrapper, {
active: false,
});
await trigger(wrapper, 'animationend', { animationName: 'rotate-end-p2' });
expect(wrapper.emitted()['loading-end']).toBeTruthy();
});

it('should not emit `loading-end` when animation with the name differed from `rotate-end-p2` stops', async () => {
const propsData = { active: true };
const wrapper = await mount(CvLoading, {
propsData,
});
await setProps(wrapper, {
active: false,
});
await trigger(wrapper, 'animationend', { animationName: 'not-rotate-end-p2' });
expect(wrapper.emitted()['loading-end']).toBeFalsy();
});
});

0 comments on commit aa03ee1

Please sign in to comment.