-
Notifications
You must be signed in to change notification settings - Fork 0
feat(projects): USFM upload and validation on a new Import tab #455
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
Open
henrique221
wants to merge
8
commits into
main
Choose a base branch
from
feat/418-usfm-import-upload
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8aa0a10
feat(projects): validate uploaded USFM and detect its book code (#418)
henrique221 9bfb29c
feat(projects): put project creation behind New/Import tabs (#418)
henrique221 f3493c8
feat(projects): upload and validate USFM files on the import tab (#418)
henrique221 ad42e5a
fix(ui): make the Tabs orientation variants actually match (#418)
henrique221 504adb2
Merge branch 'main' into feat/418-usfm-import-upload
henrique221 8a1e3c4
Merge branch 'main' into feat/418-usfm-import-upload
henrique221 901b75f
Merge branch 'main' into feat/418-usfm-import-upload
henrique221 0df6a81
fix(projects): handle repeated and overlapping USFM selections (#418)
henrique221 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 hidden or 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 hidden or 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 hidden or 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
44 changes: 44 additions & 0 deletions
44
src/features/projects/components/CreateProjectModal.test.tsx
This file contains hidden or 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,44 @@ | ||
| import { afterEach, describe, expect, it, vi } from 'vitest'; | ||
|
|
||
| import { config } from '@/lib/config'; | ||
| import { renderWithProviders, screen } from '@/test/render'; | ||
|
|
||
| import { CreateProjectModal } from './CreateProjectModal'; | ||
|
|
||
| // i18n is not part of the shared test providers, so keys come through unchanged. | ||
| vi.mock('react-i18next', () => ({ | ||
| useTranslation: () => ({ t: (key: string) => key }), | ||
| })); | ||
|
|
||
| const props = { | ||
| isOpen: true, | ||
| onClose: vi.fn(), | ||
| onSave: vi.fn(async () => {}), | ||
| }; | ||
|
|
||
| describe('CreateProjectModal tabs (#418)', () => { | ||
| afterEach(() => { | ||
| config.features.usfmImport = false; | ||
| }); | ||
|
|
||
| it('shows no tab strip while the import flag is off', () => { | ||
| config.features.usfmImport = false; | ||
| renderWithProviders(<CreateProjectModal {...props} />); | ||
| expect(screen.queryByRole('tab', { name: 'importTab' })).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('offers the Import tab once the flag is on', () => { | ||
| config.features.usfmImport = true; | ||
| renderWithProviders(<CreateProjectModal {...props} />); | ||
| expect(screen.getByRole('tab', { name: 'importTab' })).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| // The blank-project flow moved into the New tab untouched; this is the guard that the move | ||
| // did not drop it. | ||
| it('still renders the existing project fields, flag on or off', () => { | ||
| config.features.usfmImport = true; | ||
| renderWithProviders(<CreateProjectModal {...props} />); | ||
| expect(screen.getByText('projectTitle')).toBeInTheDocument(); | ||
| expect(screen.getByText('sourceLanguage')).toBeInTheDocument(); | ||
| }); | ||
| }); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.