-
Notifications
You must be signed in to change notification settings - Fork 7
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
(fix) O3-3890 Help menu (and menu items) should use a standard Carbon… #21
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -28,3 +28,11 @@ | |||||
|
||||||
} | ||||||
} | ||||||
|
||||||
.tutorialsText { | ||||||
padding: 0.5rem 0.5rem; | ||||||
} | ||||||
|
||||||
.tutorialsText:hover { | ||||||
background: #e8e8e8; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,26 @@ | ||||||||||
import React from "react"; | ||||||||||
import { render, screen, fireEvent } from "@testing-library/react"; | ||||||||||
import '@testing-library/jest-dom'; | ||||||||||
import { showModal } from "@openmrs/esm-framework"; | ||||||||||
import Tutorial from "./tutorial"; | ||||||||||
|
||||||||||
jest.mock('@openmrs/esm-framework', () => ({ | ||||||||||
showModal: jest.fn(), | ||||||||||
})) | ||||||||||
Comment on lines
+7
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
And then replace |
||||||||||
|
||||||||||
describe('Tutorial Component', () => { | ||||||||||
it('renders the menu item with the correct label', () => { | ||||||||||
render(<Tutorial />); | ||||||||||
|
||||||||||
expect(screen.getByText(/Tutorials/i)).toBeInTheDocument(); | ||||||||||
}) | ||||||||||
|
||||||||||
it('calls showModal when the menu item is clicked', () => { | ||||||||||
render(<Tutorial />); | ||||||||||
|
||||||||||
const menuItem = screen.getByText(/Tutorials/i); | ||||||||||
fireEvent.click(menuItem); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer userEvent instead. |
||||||||||
|
||||||||||
expect(showModal).toHaveBeenCalledWith('tutorial-modal', expect.any(Object)) | ||||||||||
}) | ||||||||||
}) |
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.
nit: