Skip to content

Commit

Permalink
Upgrade to Jest 22.0.6 (elastic#16041)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimjoar committed Jan 16, 2018
1 parent 1a79309 commit 7a77e57
Show file tree
Hide file tree
Showing 7 changed files with 357 additions and 277 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"ansicolors": "0.3.2",
"autoprefixer": "6.5.4",
"babel-core": "6.21.0",
"babel-jest": "21.0.0",
"babel-jest": "^22.0.6",
"babel-loader": "7.1.2",
"babel-plugin-add-module-exports": "0.2.1",
"babel-plugin-transform-async-generator-functions": "6.24.1",
Expand Down Expand Up @@ -241,7 +241,7 @@
"eslint": "4.14.0",
"eslint-plugin-babel": "4.1.2",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-jest": "21.5.0",
"eslint-plugin-jest": "^21.6.2",
"eslint-plugin-mocha": "4.11.0",
"eslint-plugin-prefer-object-spread": "1.2.1",
"eslint-plugin-react": "7.5.1",
Expand All @@ -268,8 +268,8 @@
"husky": "0.8.1",
"image-diff": "1.6.0",
"istanbul-instrumenter-loader": "3.0.0",
"jest": "21.2.1",
"jest-cli": "21.2.1",
"jest": "^22.0.6",
"jest-cli": "^22.0.6",
"jimp": "0.2.28",
"jsdom": "9.9.1",
"karma": "1.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exports[`renders DashboardGrid 1`] = `
"destroy": [Function],
"getEditPath": [Function],
"getTitleFor": [Function],
"render": [Function],
"render": [MockFunction],
}
}
getContainerApi={[Function]}
Expand All @@ -55,7 +55,7 @@ exports[`renders DashboardGrid 1`] = `
"destroy": [Function],
"getEditPath": [Function],
"getTitleFor": [Function],
"render": [Function],
"render": [MockFunction],
}
}
getContainerApi={[Function]}
Expand Down
1 change: 0 additions & 1 deletion src/dev/jest/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"setupFiles": [
"<rootDir>/src/dev/jest/setup/babel_polyfill.js",
"<rootDir>/src/dev/jest/setup/request_animation_frame_polyfill.js",
"<rootDir>/src/dev/jest/setup/enzyme.js"
],
"coverageDirectory": "<rootDir>/target/jest-coverage",
Expand Down
22 changes: 0 additions & 22 deletions src/dev/jest/setup/request_animation_frame_polyfill.js

This file was deleted.

11 changes: 10 additions & 1 deletion ui_framework/src/components/context_menu/context_menu.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from '../../test';

import { KuiContextMenu } from './context_menu';
import { setTimeout } from 'timers';

const panel2 = {
id: 2,
Expand Down Expand Up @@ -43,6 +44,10 @@ const panels = [
panel2,
];

const tick = (ms = 0) => new Promise(resolve => {
setTimeout(resolve, ms);
});

describe('KuiContextMenu', () => {
test('is rendered', () => {
const component = render(
Expand All @@ -67,20 +72,24 @@ describe('KuiContextMenu', () => {
.toMatchSnapshot();
});

it('allows you to click the title button to go back to the previous panel', () => {
it('allows you to click the title button to go back to the previous panel', async () => {
const component = mount(
<KuiContextMenu
panels={panels}
initialPanelId={2}
/>
);

await tick(20);

expect(takeMountedSnapshot(component))
.toMatchSnapshot();

// Navigate to a different panel.
component.find('[data-test-subj="contextMenuPanelTitleButton"]').simulate('click');

await tick(20);

expect(takeMountedSnapshot(component))
.toMatchSnapshot();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ exports[`renders KuiListingTable 1`] = `
aria-label="Select all rows"
class="kuiCheckBox"
type="checkbox"
value="on"
/>
</div>
</th>
Expand Down Expand Up @@ -80,6 +81,7 @@ exports[`renders KuiListingTable 1`] = `
aria-label="Select row"
class="kuiCheckBox"
type="checkbox"
value="on"
/>
</div>
</td>
Expand Down Expand Up @@ -115,6 +117,7 @@ exports[`renders KuiListingTable 1`] = `
aria-label="Select row"
class="kuiCheckBox"
type="checkbox"
value="on"
/>
</div>
</td>
Expand Down Expand Up @@ -150,6 +153,7 @@ exports[`renders KuiListingTable 1`] = `
aria-label="Select row"
class="kuiCheckBox"
type="checkbox"
value="on"
/>
</div>
</td>
Expand Down
Loading

0 comments on commit 7a77e57

Please sign in to comment.