-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: create test for UploadNotesStep component
- Loading branch information
Showing
12 changed files
with
100 additions
and
54 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
presets: [ | ||
'@babel/preset-env', | ||
'@babel/preset-react', | ||
'@babel/preset-typescript', | ||
], | ||
}; | ||
|
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
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
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
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
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 +1,3 @@ | ||
import '@testing-library/jest-dom/extend-expect'; | ||
import '@testing-library/jest-dom'; | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export interface Notes { | ||
text: string; | ||
id: string; | ||
level: string; | ||
} | ||
|
||
export interface Worksheet { | ||
date: string; | ||
id: string; | ||
text: string; | ||
level: string; | ||
} | ||
|
||
export interface FormState { | ||
notes: Notes; | ||
worksheet: Worksheet; | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import { render, screen, fireEvent } from '@testing-library/react'; | ||
import UploadNotesStep from '@/components/notes/CreateWorksheetForm/UploadNotesPage/UploadNotesStep'; | ||
|
||
describe('UploadNotesStep', () => { | ||
it('renders upload document button', () => { | ||
render(<UploadNotesStep next={() => {}} />); | ||
const uploadButton = screen.getByText('Upload Document'); | ||
expect(uploadButton).toBeInTheDocument(); | ||
}); | ||
|
||
it('renders paste YouTube link button', () => { | ||
render(<UploadNotesStep next={() => {}} />); | ||
const youtubeButton = screen.getByText('Paste YouTube Link'); | ||
expect(youtubeButton).toBeInTheDocument(); | ||
}); | ||
|
||
it('renders paste text button', () => { | ||
render(<UploadNotesStep next={() => {}} />); | ||
const pasteTextButton = screen.getByText('Paste Text'); | ||
expect(pasteTextButton).toBeInTheDocument(); | ||
}); | ||
|
||
it('changes active tab on button click', () => { | ||
render(<UploadNotesStep next={() => {}} />); | ||
const youtubeButton = screen.getByText('Paste YouTube Link'); | ||
fireEvent.click(youtubeButton); | ||
const youtubeLinkInput = screen.getByPlaceholderText('Enter YouTube link'); | ||
expect(youtubeLinkInput).toBeInTheDocument(); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"jsx": "react" | ||
} | ||
} | ||
|
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