Skip to content

Commit

Permalink
tests fixs
Browse files Browse the repository at this point in the history
  • Loading branch information
asanzo committed Oct 6, 2023
1 parent 81af724 commit 4c2145a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/test/Creator/CreatorSelection.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { render, screen } from '@testing-library/react'
import { BrowserRouter } from 'react-router-dom';
import { screen } from '@testing-library/react'
import { ActorSelection } from '../../components/creator/ActorSelection/ActorSelection';
import { LocalStorage } from '../../localStorage';
import { defaultChallenge } from "../../components/serializedChallenge"
import { renderComponent } from '../testUtils';

describe('Creator selection', () => {
afterEach(() => {
Expand All @@ -11,7 +11,7 @@ describe('Creator selection', () => {

test('Shows warning modal if there is a challenge in progress', async () => {
LocalStorage.saveCreatorChallenge(defaultChallenge("Duba"))
render(<BrowserRouter><ActorSelection /></BrowserRouter>)
renderComponent(<ActorSelection />)

const dialog = await screen.findByTestId("challenge-progress-warning")

Expand All @@ -20,7 +20,7 @@ describe('Creator selection', () => {
})

test('Should not show warning modal if there is no challenge in progress', async () => {
render(<BrowserRouter><ActorSelection /></BrowserRouter>)
renderComponent(<ActorSelection />)

const find: Promise<HTMLElement> = screen.findByTestId("challenge-progress-warning")

Expand Down
2 changes: 1 addition & 1 deletion src/test/MainRoutesComponents.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test('Renders home without errors', async () => {
expect(() => renderComponent(<Home />)).not.toThrowError()
})
test('Renders a challenge without errors', async () => {
expect(() => renderComponent(<ChallengeById/>, '/desafio/:id', '1')).not.toThrowError()
expect(() => renderComponent(<ChallengeById/>, '/desafio/:id', '1001')).not.toThrowError()
})

test('Renders the book challenge list without errors', async () => {
Expand Down

0 comments on commit 4c2145a

Please sign in to comment.