-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove uppy and use upload hooks (#1295)
* feat: remove uppy and use upload hooks * refactor: update tests * refactor: fix test * refactor: fix return type * refactor: update ui * refactor: update deps
- Loading branch information
Showing
51 changed files
with
1,077 additions
and
1,910 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
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,65 @@ | ||
import { ItemType, PackedFolderItemFactory } from '@graasp/sdk'; | ||
|
||
import { HOME_PATH, buildItemPath } from '../../../../src/config/paths'; | ||
import { | ||
CREATE_ITEM_BUTTON_ID, | ||
H5P_DASHBOARD_UPLOADER_ID, | ||
} from '../../../../src/config/selectors'; | ||
import ItemLayoutMode from '../../../../src/enums/itemLayoutMode'; | ||
import { createItem } from '../../../support/createUtils'; | ||
|
||
const NEW_H5P_ITEM = { | ||
filepath: 'files/accordion.h5p', | ||
type: ItemType.H5P, | ||
}; | ||
|
||
describe('Import H5P', () => { | ||
it('import h5p on Home', () => { | ||
cy.setUpApi(); | ||
cy.visit(HOME_PATH); | ||
|
||
cy.switchMode(ItemLayoutMode.List); | ||
|
||
// create | ||
|
||
createItem(NEW_H5P_ITEM); | ||
|
||
// check interface didn't crash | ||
cy.wait(2000); | ||
cy.get(`#${CREATE_ITEM_BUTTON_ID}`).should('be.visible'); | ||
}); | ||
|
||
it('create file in item', () => { | ||
const FOLDER = PackedFolderItemFactory(); | ||
|
||
cy.setUpApi({ items: [FOLDER] }); | ||
const { id } = FOLDER; | ||
cy.visit(buildItemPath(id)); | ||
|
||
cy.switchMode(ItemLayoutMode.List); | ||
|
||
// create | ||
createItem(NEW_H5P_ITEM); | ||
|
||
// check interface didn't crash | ||
cy.wait(3000); | ||
cy.get(`#${CREATE_ITEM_BUTTON_ID}`).should('be.visible'); | ||
}); | ||
|
||
it('catch error', () => { | ||
const FOLDER = PackedFolderItemFactory(); | ||
|
||
cy.setUpApi({ items: [FOLDER], importH5pError: true }); | ||
const { id } = FOLDER; | ||
cy.visit(buildItemPath(id)); | ||
|
||
cy.switchMode(ItemLayoutMode.List); | ||
|
||
// create | ||
createItem(NEW_H5P_ITEM); | ||
|
||
// H5P Upload button is still visible | ||
cy.wait(3000); | ||
cy.get(`#${H5P_DASHBOARD_UPLOADER_ID}`).should('be.visible'); | ||
}); | ||
}); |
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
Binary file not shown.
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
Oops, something went wrong.