Skip to content

Commit

Permalink
Merge pull request #2337 from openedx/vrusakov/sync-alpha
Browse files Browse the repository at this point in the history
sync: alpha with master
  • Loading branch information
viktorrusakov authored and PKulkoRaccoonGang committed Aug 5, 2024
1 parent 5a1461c commit 2cf913b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Card/tests/__snapshots__/CardGrid.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ exports[`<CardGrid /> Controlled Rendering renders with controlled columnSizes 1
>
<img
className="pgn__card-image-cap"
loading="eager"
onError={[Function]}
onLoad={[Function]}
src="http://fake.image"
Expand Down
6 changes: 5 additions & 1 deletion src/Menu/SelectMenu.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ describe('correct rendering', () => {
expect(wrapper.find(Button).prop('variant')).toEqual('brand');
expect(wrapper.find('button').hasClass('btn-brand')).toEqual(true);
});
it('rendering with Brand button variant', () => {
const wrapper = mount(<DefaultSelectMenu variant="brand" />);
expect(wrapper.find(Button).prop('variant')).toEqual('brand');
expect(wrapper.find('button').hasClass('btn-brand')).toEqual(true);
});
});

describe('mouse behavior & keyboard behavior', () => {
Expand Down Expand Up @@ -115,7 +120,6 @@ describe('keyboard Interactions', () => {
await userEvent.keyboard('[arrowdown]');
expect(menuItems[1]).toHaveFocus();
});

it('should focus the next item after ArrowRight keyDown', async () => {
const { getByRole, getAllByRole } = render(defaultSelectMenu());
const menuTrigger = getByRole('button', { expanded: false });
Expand Down
6 changes: 6 additions & 0 deletions src/Tabs/Tabs.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ describe('<Tabs />', () => {
wrapper.find('.dropdown-item').at(0).simulate('keyPress', { key: 'Enter' });
expect(wrapper.find('[data-rb-event-key="tab_2"]').at(0).hasClass('active')).toEqual(true);
});
it('select dropdown item after pressing Enter', () => {
const wrapper = mount(<TabsTestComponent />);
wrapper.find('#pgn__tab-toggle').at(0).at(0).simulate('click');
wrapper.find('.dropdown-item').at(0).simulate('keyPress', { key: 'Enter' });
expect(wrapper.find('[data-rb-event-key="tab_2"]').at(0).hasClass('active')).toEqual(true);
});
it('invalid child does not render', () => {
const { getByRole } = render(
<Tabs>
Expand Down
8 changes: 5 additions & 3 deletions www/src/components/LeaveFeedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ function LeaveFeedback({ isNavLink, ...props }: LeaveFeedbackProps) {
{...props}
>
{leaveFeedbackLinkTitle}
</Nav.Link>
);
}
<Nav.Link onClick={handleLinkFeedbackClick} href={FEEDBACK_URL} target="_blank" {...props}>
Leave feedback
</Nav.Link>
);
}

return (
<Button
Expand Down
3 changes: 3 additions & 0 deletions www/src/components/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ function Layout({
<Nav.Item>
<LeaveFeedback />
</Nav.Item>
<Nav.Item>
<LeaveFeedback />
</Nav.Item>
<Nav.Item>
<LeaveFeedback className="muted-link" isNavLink />
</Nav.Item>
Expand Down

0 comments on commit 2cf913b

Please sign in to comment.