-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apps/documents/tests: adjust test of CountDown.jsx to test active sta…
…te and inactive state
- Loading branch information
Kha
committed
Dec 14, 2021
1 parent
90ae696
commit e2aca71
Showing
2 changed files
with
8 additions
and
168 deletions.
There are no files selected for viewing
16 changes: 8 additions & 8 deletions
16
meinberlin/apps/contrib/assets/__tests__/CountDown.jest.jsx
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 |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import { render } from '@testing-library/react' | ||
import { CountDown } from '../CountDown' | ||
|
||
test('CountComponent is showing inactive', () => { | ||
render( | ||
const tree = render( | ||
<CountDown | ||
activeClass="active-class" | ||
inactiveClass="inactive-class" | ||
countText="votes" | ||
counter={0} | ||
/> | ||
) | ||
const countComponent = screen.getByText('votes') | ||
expect(countComponent.innerHTML).toBe('votes') | ||
const buttonInactive = tree.container.querySelector('.inactive-class') | ||
expect(buttonInactive).toBeTruthy() | ||
}) | ||
|
||
test('CountComponent is showing active', () => { | ||
render( | ||
const tree = render( | ||
<CountDown | ||
activeClass="active-class" | ||
inactiveClass="inactive-class" | ||
countText="votes" | ||
counter={2} | ||
counter={1} | ||
/> | ||
) | ||
const countComponent = screen.getByText('votes') | ||
expect(countComponent.innerHTML).toBe('votes') | ||
const buttonActive = tree.container.querySelector('.active-class') | ||
expect(buttonActive).toBeTruthy() | ||
}) |
160 changes: 0 additions & 160 deletions
160
meinberlin/apps/documents/assets/__tests__/__snapshots__/ChapterNavItem.jest.js.snap
This file was deleted.
Oops, something went wrong.