Skip to content

Commit

Permalink
apps/documents/tests: adjust test of CountDown.jsx to test active sta…
Browse files Browse the repository at this point in the history
…te and inactive state
  • Loading branch information
Kha committed Dec 15, 2021
1 parent d6b8ad6 commit 3edb7a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 168 deletions.
16 changes: 8 additions & 8 deletions meinberlin/apps/contrib/assets/__tests__/CountDown.jest.jsx
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()
})

This file was deleted.

0 comments on commit 3edb7a7

Please sign in to comment.