Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
feat: use accessible items on home (#887)
Browse files Browse the repository at this point in the history
* feat: use accessible items on home

* refactor: fix height to line number for home

* refactor: add message on shared items page

* refactor: add margin
  • Loading branch information
pyphilia authored Dec 22, 2023
1 parent a19e49e commit 819c4a1
Show file tree
Hide file tree
Showing 46 changed files with 828 additions and 654 deletions.
11 changes: 6 additions & 5 deletions cypress/e2e/item/create/createApp.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
GRAASP_APP_ITEM,
GRAASP_CUSTOM_APP_ITEM,
} from '../../../fixtures/apps';
import { APPS_LIST } from '../../../fixtures/apps/apps';
import { SAMPLE_ITEMS } from '../../../fixtures/items';
import { createApp } from '../../../support/createUtils';

Expand All @@ -16,11 +17,11 @@ describe('Create App', () => {
cy.switchMode(ITEM_LAYOUT_MODES.LIST);

// create
createApp(GRAASP_APP_ITEM);
createApp(GRAASP_APP_ITEM, { id: APPS_LIST[0].id });

cy.wait('@postItem').then(() => {
// should update view
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
});
});

Expand All @@ -31,11 +32,11 @@ describe('Create App', () => {
cy.switchMode(ITEM_LAYOUT_MODES.LIST);

// create
createApp(GRAASP_APP_ITEM);
createApp(GRAASP_APP_ITEM, { custom: true });

cy.wait('@postItem').then(() => {
// should update view
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
});
});
});
Expand All @@ -51,7 +52,7 @@ describe('Create App', () => {
cy.switchMode(ITEM_LAYOUT_MODES.LIST);

// create
createApp(GRAASP_APP_ITEM);
createApp(GRAASP_APP_ITEM, { id: APPS_LIST[0].id });

cy.wait('@postItem').then(() => {
// expect update
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/item/create/createDocument.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Create Document', () => {

cy.wait('@postItem').then(() => {
// should update view
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
});
});

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/item/create/createFolder.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Create Folder', () => {
// create
createFolder(CREATED_ITEM);

cy.wait(['@postItem', '@getOwnItems']);
cy.wait(['@postItem', '@getAccessibleItems']);
});

it('create folder in item', () => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/item/create/createLink.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Create Link', () => {
cy.wait(CREATE_ITEM_PAUSE);

// expect update
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
});
});

Expand All @@ -43,7 +43,7 @@ describe('Create Link', () => {
cy.wait(CREATE_ITEM_PAUSE);

// expect update
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
});
});

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/item/create/createShortcut.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const checkCreateShortcutRequest = ({
expect(url).to.include(qs.stringify({ parentId: toItemId }));
} else {
expect(url).to.not.include('parentId');
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
}
});
};
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/item/delete/gridRecycleItem.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Recycle Item in Grid', () => {

// recycle
recycleItem(id);
cy.wait(['@recycleItems', '@getOwnItems']);
cy.wait(['@recycleItems', '@getAccessibleItems']);
});

it('recycle item inside parent', () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/item/delete/listRecycleItem.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Recycle Item in List', () => {
cy.wait('@recycleItems').then(({ request: { url } }) => {
expect(url).to.contain(id);
});
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
});

it('recycle item inside parent', () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/item/delete/listRecycleItems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Recycle Items in List', () => {

// delete
recycleItems([SAMPLE_ITEMS.items[0].id, SAMPLE_ITEMS.items[1].id]);
cy.wait(['@recycleItems', '@getOwnItems']);
cy.wait(['@recycleItems', '@getAccessibleItems']);
});

it('recycle 2 items in item', () => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/item/edit/editApp.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('Edit App', () => {
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(newFields.name);
cy.wait(EDIT_ITEM_PAUSE);
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
},
);
});
Expand Down Expand Up @@ -149,7 +149,7 @@ describe('Edit App', () => {
}) => {
// check item is edited and updated
cy.wait(EDIT_ITEM_PAUSE);
cy.get('@getOwnItems');
cy.get('@getAccessibleItems');
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(newFields.name);
},
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/item/edit/editDocument.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('Edit Document', () => {
expect(name).to.equal(newFields.name);
expect(getDocumentExtra(extra)?.content).to.contain(content);
cy.wait(EDIT_ITEM_PAUSE);
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
},
);
});
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('Edit Document', () => {
}) => {
// check item is edited and updated
cy.wait(EDIT_ITEM_PAUSE);
cy.get('@getOwnItems');
cy.get('@getAccessibleItems');
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(newFields.name);
expect(getDocumentExtra(extra)?.content).to.contain(content);
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/item/edit/editEtherpad.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Edit Etherpad', () => {
}) => {
// check item is edited and updated
cy.wait(EDIT_ITEM_PAUSE);
cy.get('@getOwnItems');
cy.get('@getAccessibleItems');
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(EDITED_FIELDS.name);
},
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('Edit Etherpad', () => {
}) => {
// check item is edited and updated
cy.wait(EDIT_ITEM_PAUSE);
cy.get('@getOwnItems');
cy.get('@getAccessibleItems');
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(EDITED_FIELDS.name);
},
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/item/edit/editFile.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('Edit File', () => {
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(EDITED_FIELDS.name);
cy.wait(EDIT_ITEM_PAUSE);
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
},
);
});
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('Edit File', () => {
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(EDITED_FIELDS.name);
cy.wait(EDIT_ITEM_PAUSE);
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
},
);
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/item/edit/editFolder.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('Edit Folder', () => {
expect(name).to.equal(EDITED_FIELDS.name);
expect(description).to.contain(newDescription);
cy.wait(EDIT_ITEM_PAUSE);
cy.wait('@getOwnItems');
cy.wait('@getAccessibleItems');
},
);
});
Expand Down Expand Up @@ -167,7 +167,7 @@ describe('Edit Folder', () => {
}) => {
// check item is edited and updated
cy.wait(EDIT_ITEM_PAUSE);
cy.get('@getOwnItems');
cy.get('@getAccessibleItems');
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(EDITED_FIELDS.name);
},
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/item/edit/editH5p.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Edit H5P', () => {
}) => {
// check item is edited and updated
cy.wait(EDIT_ITEM_PAUSE);
cy.get('@getOwnItems');
cy.get('@getAccessibleItems');
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(EDITED_FIELDS.name);
},
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('Edit H5P', () => {
}) => {
// check item is edited and updated
cy.wait(EDIT_ITEM_PAUSE);
cy.get('@getOwnItems');
cy.get('@getAccessibleItems');
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(EDITED_FIELDS.name);
},
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/item/edit/editLink.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('Edit Link', () => {
}) => {
// check item is edited and updated
cy.wait(EDIT_ITEM_PAUSE);
cy.get('@getOwnItems');
cy.get('@getAccessibleItems');
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(EDITED_FIELDS.name);
},
Expand Down Expand Up @@ -106,7 +106,7 @@ describe('Edit Link', () => {
}) => {
// check item is edited and updated
cy.wait(EDIT_ITEM_PAUSE);
cy.get('@getOwnItems');
cy.get('@getAccessibleItems');
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(EDITED_FIELDS.name);
},
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/item/edit/editShortcut.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Edit Shortcut', () => {
}) => {
// check item is edited and updated
cy.wait(EDIT_ITEM_PAUSE);
cy.get('@getOwnItems');
cy.get('@getAccessibleItems');
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(EDITED_FIELDS.name);
},
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('Edit Shortcut', () => {
}) => {
// check item is edited and updated
cy.wait(EDIT_ITEM_PAUSE);
cy.get('@getOwnItems');
cy.get('@getAccessibleItems');
expect(id).to.equal(itemToEdit.id);
expect(name).to.equal(EDITED_FIELDS.name);
},
Expand Down
Loading

0 comments on commit 819c4a1

Please sign in to comment.