generated from openmrs/openmrs-esm-template-app
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) O3-3890 Help menu (and menu items) should use a standard Carbon…
… menu
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,10 @@ | |
|
||
} | ||
} | ||
|
||
.tutorialMenuItem { | ||
color: black !important; | ||
&:focus { | ||
outline: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(), | ||
})) | ||
|
||
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); | ||
|
||
expect(showModal).toHaveBeenCalledWith('tutorial-modal', expect.any(Object)) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters