-
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.
- Loading branch information
Showing
44 changed files
with
1,112 additions
and
693 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ export const MEMBERS = { | |
BOB: { id: 'bob-id', name: 'bob', email: '[email protected]' }, | ||
}; | ||
|
||
export const SIMPLE_ITEMS = [ | ||
export const SAMPLE_ITEMS = [ | ||
{ | ||
...DEFAULT_ITEM, | ||
id: 'ecafbd2a-5688-11eb-ae93-0242ac130002', | ||
|
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,46 @@ | ||
import { ITEM_TYPES } from '../../src/config/constants'; | ||
|
||
export const GRAASP_LINK_ITEM = { | ||
id: 'ecafbd2a-5688-11eb-ae91-0242ac130002', | ||
type: ITEM_TYPES.LINK, | ||
name: 'graasp link', | ||
description: 'a description for graasp link', | ||
path: 'ecafbd2a_5688_11eb_ae93_0242ac130002', | ||
extra: { | ||
embeddedLinkItem: { | ||
url: 'https://graasp.eu', | ||
thumbnails: ['https://graasp.eu/img/epfl/logo-tile.png'], | ||
icons: [ | ||
'https://graasp.eu/cdn/img/epfl/favicons/favicon-32x32.png?v=yyxJ380oWY', | ||
], | ||
}, | ||
}, | ||
}; | ||
|
||
export const YOUTUBE_LINK_ITEM = { | ||
id: 'gcafbd2a-5688-11eb-ae93-0242ac130002', | ||
type: ITEM_TYPES.LINK, | ||
name: 'graasp youtube link', | ||
description: 'a description for graasp youtube link', | ||
path: 'gcafbd2a_5688_11eb_ae93_0242ac130002', | ||
extra: { | ||
embeddedLinkItem: { | ||
url: 'https://www.youtube.com/watch?v=FmiEgBMTPLo', | ||
html: | ||
'<div style="left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.25%;"><iframe src="https://www.youtube.com/embed/FmiEgBMTPLo" style="border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;" allowfullscreen scrolling="no" allow="encrypted-media"></iframe></div>', | ||
thumbnails: ['https://i.ytimg.com/vi/FmiEgBMTPLo/maxresdefault.jpg'], | ||
icons: ['https://www.youtube.com/s/desktop/f0ff6c1d/img/favicon_96.png'], | ||
}, | ||
}, | ||
}; | ||
|
||
export const INVALID_LINK_ITEM = { | ||
type: ITEM_TYPES.LINK, | ||
name: 'graasp youtube link', | ||
description: 'a description for graasp youtube link', | ||
extra: { | ||
embeddedLinkItem: { | ||
url: 'wrong link', | ||
}, | ||
}, | ||
}; |
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,47 @@ | ||
import { MODES, DEFAULT_MODE } from '../../../../src/config/constants'; | ||
import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; | ||
import { IMAGE_ITEM_DEFAULT, IMAGE_ITEM_S3 } from '../../../fixtures/files'; | ||
import { SAMPLE_ITEMS } from '../../../fixtures/items'; | ||
import { CREATE_ITEM_PAUSE } from '../../../support/constants'; | ||
import { createItem } from './utils'; | ||
|
||
describe('Create File', () => { | ||
it('create file on Home', () => { | ||
cy.setUpApi(); | ||
cy.visit(HOME_PATH); | ||
|
||
if (DEFAULT_MODE !== MODES.LIST) { | ||
cy.switchMode(MODES.LIST); | ||
} | ||
|
||
// create | ||
createItem(IMAGE_ITEM_DEFAULT, MODES.LIST); | ||
|
||
cy.wait('@uploadItem').then(() => { | ||
// check item is created and displayed | ||
cy.wait(CREATE_ITEM_PAUSE); | ||
// should update view | ||
cy.wait('@getOwnItems'); | ||
}); | ||
}); | ||
|
||
it('create file in item', () => { | ||
cy.setUpApi({ items: SAMPLE_ITEMS }); | ||
const { id } = SAMPLE_ITEMS[0]; | ||
|
||
// go to children item | ||
cy.visit(buildItemPath(id)); | ||
|
||
if (DEFAULT_MODE !== MODES.LIST) { | ||
cy.switchMode(MODES.LIST); | ||
} | ||
|
||
// create | ||
createItem(IMAGE_ITEM_S3, MODES.LIST); | ||
|
||
cy.wait('@uploadItem').then(() => { | ||
// should update view | ||
cy.wait('@getItem'); | ||
}); | ||
}); | ||
}); |
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.