-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grade upload/#9 #41
Merged
Merged
grade upload/#9 #41
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2dfa861
feat: implement upload-file component
yougyung 75c9882
chore: commit for merge
yougyung c3bc1ba
feat: implement file-upload manual
yougyung 8c37597
feat: implement useFile hook
yougyung d0548ce
feat: add file-upload stories
yougyung 1930ff7
chore: fix example variable
yougyung 7ea12c6
refactor: api request in server component
yougyung 4dc8853
chore: add todo comment
yougyung edad423
chore: commit for merge
yougyung 8006519
fix: upload grade structure
yougyung 39fe4d7
refactor: use form component
yougyung 421c5d0
feat: add fileupload test
yougyung c87c9fc
fix: remove fileinput drag&drop handler
yougyung b38ff02
rename: change to usePdfFile, uploadTakenLecture
yougyung b3dac84
style: add option truncate
yougyung a7486e6
chore: remove unnecessary code
yougyung f05c75e
fix: change variable name
yougyung c54c917
fix: change target grade-upload test
yougyung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,18 +1,30 @@ | ||
import UploadPdf from '@/app/ui/view/molecule/upload-pdf/upload-pdf'; | ||
import { render, screen } from '@testing-library/react'; | ||
import fireEvent from '@testing-library/user-event'; | ||
import { userEvent } from '@testing-library/user-event'; | ||
|
||
describe('์ฑ์ ์ ๋ก๋', () => { | ||
it('pdf๊ฐ ์๋ ํ์ผ์ ์ ๋ก๋ํ ์ ์๋ค', async () => { | ||
it('ํ์ผ์ด ์ ๋ก๋ ๋ ๋, pdf file์ ์ ๋ก๋ ํ๋ฉด file๋ช ์ด ๋ ธ์ถ๋๋ค.', async () => { | ||
render(<UploadPdf />); | ||
|
||
const targetFile = new File(['grade'], 'grade.pdf', { | ||
type: 'text/plain', | ||
}); | ||
|
||
const uploadBox = await screen.findByTestId('upload-box'); | ||
fireEvent.upload(uploadBox, targetFile); | ||
await userEvent.upload(uploadBox, targetFile); | ||
|
||
expect(screen.queryByText('์ถ๊ฐ')).not.toBeInTheDocument(); | ||
expect(screen.getByText(targetFile.name)).toBeInTheDocument(); | ||
}); | ||
|
||
it('ํ์ผ์ด ์ ๋ก๋ ๋ ๋, pdf๊ฐ ์๋ file์ ์ ๋ก๋ ํ๋ฉด ๋ณํ๊ฐ ๋ฐ์ํ์ง์๋๋ค.', async () => { | ||
render(<UploadPdf />); | ||
|
||
const targetFile = new File(['grade'], 'grade.png', { | ||
type: 'text/plain', | ||
}); | ||
|
||
const uploadBox = await screen.findByTestId('upload-box'); | ||
await userEvent.upload(uploadBox, targetFile); | ||
expect(screen.queryByText('๋ง์ฐ์ค๋ก ๋๋๊ทธ ํ๊ฑฐ๋ ์์ด์ฝ์ ๋๋ฌ ์ถ๊ฐํด์ฃผ์ธ์.')).toBeInTheDocument(); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getByText๋ queryByText ์ฌ์ฉํ๋ ๊ธฐ์ค์ ์ฌ์ญค๋ด๋ ๋ ๊น์!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ฐ๋ฐ๊ณผ์ ์์ ๋ก์ง์ ์ํด ๋ฉ์๋๋ฅผ ๋ค๋ฅด๊ฒ ๊ฐ์ ธ๊ฐ๋๋ฐ, ๋ณ๊ฒฝ์ด ๋ฐ์ํ๋ฉด์ ํ์ฌ๋ ์ด๋ค ๋ฉ์๋๋ฅผ ์ฌ์ฉํด๋ ์ ์ฉ์ด ๋๋ ์ํฉ์ ๋๋ค!