Skip to content

Commit 2e29270

Browse files
TRAPWLS-19 test case updated
1 parent 7a6e8d8 commit 2e29270

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/App.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { render, screen } from '@testing-library/react';
22
import Popup from './popup/Popup';
3-
import { APP_INITIAL_POPUP_MSG } from './utility/constants';
43

54
//clear local storage
65
beforeEach(() => {
76
localStorage.clear();
87
});
98

10-
describe('App component', () => {
11-
test('renders popup with image, message, and button', () => {
9+
describe("popup component", () => {
10+
test("renders popup with image, message, and button", () => {
1211
const mockSetShowPopup = jest.fn(); //mock function
1312

1413
// Render the Popup component
@@ -18,8 +17,9 @@ describe('App component', () => {
1817
expect(popupImage).toBeInTheDocument();
1918
expect(popupImage).toHaveAttribute('src','favicon1.ico');
2019

21-
const message = screen.getByText(APP_INITIAL_POPUP_MSG);
22-
expect(message).toBeInTheDocument();
20+
const boldText1 = document.querySelector('b');
21+
expect(boldText1).toBeInTheDocument();
22+
expect(boldText1.textContent).toBe('myself');
2323

2424
//check ok button
2525
const button = screen.getByRole('button',{name:/OK/i});

0 commit comments

Comments
 (0)