We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 131e671 commit 9ee894eCopy full SHA for 9ee894e
src/App.test.js
@@ -6,3 +6,15 @@ test('displays title correctly', () => {
6
const titleElement = screen.getByText(/endless simple idle game/i);
7
expect(titleElement).toBeInTheDocument();
8
});
9
+test('displays points value', () => {
10
+ render(<App />);
11
+ const pointsElement = screen.getByText((content, element) => {
12
+ const hasText = (node) => node.textContent.match(/points: \d+/i);
13
+ const elementHasText = hasText(element);
14
+ const childrenDontHaveText = Array.from(element.children).every(
15
+ (child) => !hasText(child),
16
+ );
17
+ return elementHasText && childrenDontHaveText;
18
+ });
19
+ expect(pointsElement).toBeInTheDocument();
20
+});
0 commit comments