Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Jest 22.0.6 #16041

Merged
merged 1 commit into from
Jan 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"angular-sortable-view": "0.0.15",
"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 @@ -240,7 +240,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 @@ -266,8 +266,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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the requestAnimationFrame code in that component is the reason I had to do this.


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