-
Notifications
You must be signed in to change notification settings - Fork 377
feat(Tabs): Added OUIA compatibility to Tabs component #2704
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
Conversation
|
PatternFly-React preview: https://patternfly-react-pr-2704.surge.sh |
redallen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed snapshots :)
| key="2/.2" | ||
| /> | ||
| </Fragment> | ||
| <ContextConsumer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@redallen first off, thanks for help. But are you sure this snap will actually cover test scenario? It's basically empty, and it doesn't look like it will ensure "should render tabs with eventKey Strings".
Appologies if it's a dumb question, i'm pretty new to jest testing, trying to understand to not introduce same mistakes in future PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff is too big so GH points to wrong line. My question was re this snap:
exports[`should render tabs with eventKey Strings 1`] = `
<ContextConsumer>
<Component />
</ContextConsumer>
`;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it makes sense to make the snapshot tests that use OUIA use mount instead of shallow since there's now a <ContextConsumer>.
|
@redallen so i returned branch to previous state with |
|
Yes, this is the same issue I fixed yesterday. You have to fix the selectors Jest uses for those tests since now there's a |
|
@redallen not sure if i follow. Those 2 failing tests are comparing mount result with snap, no interactions and no css selectors are used there. |
|
Thanks for adding this! I think that the best way would be to replace |
|
Good call @karelhala , I've updated the PR with that, and I wouldn't have thought of that 👍 I am rather confused why test('should render secondary tabs', () => {
const view = render(
<Tabs id="primarieTabs">
<Tab eventKey={0} title="Tab item 1">
<Tabs id="secondaryTabs">
<Tab id="secondary tab1" eventKey={10} title="Secondary Tab 1">
Secondary Tab 1 section
</Tab>
<Tab id="secondary tab2" eventKey={11} title="Secondary Tab 2">
Secondary Tab 2 section
</Tab>
<Tab id="secondary tab3" eventKey={12} title="Secondary Tab 3">
Secondary Tab 3 section
</Tab>
</Tabs>
</Tab>
<Tab id="tab2" eventKey={1} title="Tab item 2">
Tab 2 section
</Tab>
<Tab id="tab3" eventKey={2} title="Tab item 3">
Tab 3 section
</Tab>
</Tabs>
);
expect(view).toMatchSnapshot();
});test('should render tabs with eventKey Strings', () => {
const view = render(
<Tabs id="eventKeyTabs">
<Tab id="tab1" eventKey={'one'} title="Tab item 1">
Tab 1 section
</Tab>
<Tab id="tab2" eventKey={'two'} title="Tab item 2">
Tab 2 section
</Tab>
<Tab id="tab3" eventKey={'three'} title="Tab item 3">
Tab 3 section
</Tab>
</Tabs>
);
expect(view).toMatchSnapshot();
}); |
karelhala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
|
Your changes have been released in:
Thanks for your contribution! 🎉 |
What: Added OUIA props to Tabs as per #2425
Additional issues: 2 Tabs tests are failing after this change. Any help with figuring out what's causing the issue is appreciated.