Skip to content

Commit

Permalink
chore: update deps (#740)
Browse files Browse the repository at this point in the history
* chore: update deps

* fix: redirection link to https

* fix: add timeout

* chore: update deps

* fix: remove waits

* fix: add a small pause to allow test to complete

* chore: fix tests

* fix(ci): use old headless mode
  • Loading branch information
spaenleh authored Aug 17, 2023
1 parent 22a8baf commit 04a7afb
Show file tree
Hide file tree
Showing 14 changed files with 374 additions and 515 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ jobs:
cypress:
name: Cypress
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Yarn Install and Cache
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1
with:
Expand Down
6 changes: 6 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export default defineConfig({
setupNodeEvents(on, config) {
// eslint-disable-next-line @typescript-eslint/no-var-requires, global-require
require('@cypress/code-coverage/task')(on, config);
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args.push('--headless=old');
}
return launchOptions;
});
return config;
},
baseUrl: `http://localhost:${process.env.VITE_PORT || 3333}`,
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/item/apps/apps.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Apps', () => {
cy.setUpApi({ items: [APP_USING_CONTEXT_ITEM] });
cy.visit(buildItemPath(id));

cy.wait(3000);
cy.wait(2000);

const iframeSelector = `iframe[title="${name}"]`;

Expand Down
5 changes: 0 additions & 5 deletions cypress/e2e/item/create/createApp.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { HOME_PATH, buildItemPath } from '../../../../src/config/paths';
import ITEM_LAYOUT_MODES from '../../../../src/enums/itemLayoutModes';
import { GRAASP_APP_ITEM } from '../../../fixtures/apps';
import { SAMPLE_ITEMS } from '../../../fixtures/items';
import { CREATE_ITEM_PAUSE } from '../../../support/constants';
import { createApp } from '../../../support/createUtils';

describe('Create App', () => {
Expand All @@ -17,8 +16,6 @@ describe('Create App', () => {
createApp(GRAASP_APP_ITEM);

cy.wait('@postItem').then(() => {
// check item is created and displayed
cy.wait(CREATE_ITEM_PAUSE);
// should update view
cy.wait('@getOwnItems');
});
Expand All @@ -34,8 +31,6 @@ describe('Create App', () => {
createApp(GRAASP_APP_ITEM);

cy.wait('@postItem').then(() => {
// check item is created and displayed
cy.wait(CREATE_ITEM_PAUSE);
// should update view
cy.wait('@getOwnItems');
});
Expand Down
3 changes: 0 additions & 3 deletions cypress/e2e/item/create/createDocument.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { HOME_PATH, buildItemPath } from '../../../../src/config/paths';
import ITEM_LAYOUT_MODES from '../../../../src/enums/itemLayoutModes';
import { GRAASP_DOCUMENT_ITEM } from '../../../fixtures/documents';
import { SAMPLE_ITEMS } from '../../../fixtures/items';
import { CREATE_ITEM_PAUSE } from '../../../support/constants';
import { createDocument } from '../../../support/createUtils';

describe('Create Document', () => {
Expand All @@ -16,8 +15,6 @@ describe('Create Document', () => {
createDocument(GRAASP_DOCUMENT_ITEM);

cy.wait('@postItem').then(() => {
// check item is created and displayed
cy.wait(CREATE_ITEM_PAUSE);
// should update view
cy.wait('@getOwnItems');
});
Expand Down
17 changes: 6 additions & 11 deletions cypress/e2e/item/create/createFolder.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from '../../../../src/config/selectors';
import ITEM_LAYOUT_MODES from '../../../../src/enums/itemLayoutModes';
import { CREATED_ITEM, SAMPLE_ITEMS } from '../../../fixtures/items';
import { CREATE_ITEM_PAUSE } from '../../../support/constants';
import { createFolder } from '../../../support/createUtils';

describe('Create Folder', () => {
Expand Down Expand Up @@ -51,16 +50,12 @@ describe('Create Folder', () => {
// create
createFolder(CREATED_ITEM);

cy.wait('@postItem').then(() => {
// check item is created and displayed
cy.wait(CREATE_ITEM_PAUSE);
// expect update
cy.wait('@getOwnItems');

// form is cleared
cy.get(`#${CREATE_ITEM_BUTTON_ID}`).click({ force: true });
cy.get(`#${ITEM_FORM_NAME_INPUT_ID}`).should('have.value', '');
});
cy.wait('@postItem');
// small necessary pause required in order for the form to be able to reset
cy.wait(300);
// form is cleared
cy.get(`#${CREATE_ITEM_BUTTON_ID}`).click({ force: true });
cy.get(`#${ITEM_FORM_NAME_INPUT_ID}`).should('have.value', '');
});

it('create folder in item', () => {
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/item/create/createShortcut.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import ITEM_LAYOUT_MODES from '../../../../src/enums/itemLayoutModes';
import { buildShortcutExtra } from '../../../../src/utils/itemExtra';
import { IMAGE_ITEM_DEFAULT } from '../../../fixtures/files';
import { SAMPLE_ITEMS } from '../../../fixtures/items';
import { TABLE_ITEM_RENDER_TIME } from '../../../support/constants';

const createShortcut = ({
id,
Expand Down Expand Up @@ -44,7 +43,7 @@ const createShortcutInList = ({
id: string;
toItemPath?: string;
}) => {
cy.wait(TABLE_ITEM_RENDER_TIME);
// cy.wait(TABLE_ITEM_RENDER_TIME);
const menuSelector = `#${buildItemMenuButtonId(id)}`;
cy.get(menuSelector).click();
createShortcut({ id, toItemPath });
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/item/delete/gridRecycleItem.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import {
} from '../../../../src/config/selectors';
import { ITEM_LAYOUT_MODES } from '../../../../src/enums';
import { SAMPLE_ITEMS } from '../../../fixtures/items';
import { TABLE_ITEM_RENDER_TIME } from '../../../support/constants';

const recycleItem = (id: string) => {
const menuSelector = `#${buildItemMenuButtonId(id)}`;
cy.wait(TABLE_ITEM_RENDER_TIME);
// cy.wait(TABLE_ITEM_RENDER_TIME);
cy.get(menuSelector).click();
cy.get(`#${buildItemMenu(id)} .${ITEM_MENU_RECYCLE_BUTTON_CLASS}`).click();
};
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/item/delete/listDeleteItem.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import {
} from '../../../../src/config/selectors';
import { ITEM_LAYOUT_MODES } from '../../../../src/enums';
import { RECYCLED_ITEM_DATA, SAMPLE_ITEMS } from '../../../fixtures/items';
import { TABLE_ITEM_RENDER_TIME } from '../../../support/constants';

const deleteItem = (id: string) => {
cy.wait(TABLE_ITEM_RENDER_TIME);
// cy.wait(TABLE_ITEM_RENDER_TIME);
cy.get(
`${buildItemsTableRowIdAttribute(id)} .${ITEM_DELETE_BUTTON_CLASS}`,
).click();
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/item/delete/listDeleteItems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import {
} from '../../../../src/config/selectors';
import { ITEM_LAYOUT_MODES } from '../../../../src/enums';
import { RECYCLED_ITEM_DATA, SAMPLE_ITEMS } from '../../../fixtures/items';
import { TABLE_ITEM_RENDER_TIME } from '../../../support/constants';

const deleteItems = (itemIds: string[]) => {
// check selected ids
itemIds.forEach((id) => {
cy.wait(TABLE_ITEM_RENDER_TIME);
// cy.wait(TABLE_ITEM_RENDER_TIME);
cy.get(`${buildItemsTableRowIdAttribute(id)} .ag-checkbox-input`).click();
});

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/redirection.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const DOMAIN = Cypress.env('REACT_APP_GRAASP_DOMAIN');

describe('Redirection', () => {
it('Redirection to saved url', () => {
const link = 'http://somelink.com';
const link = 'https://graasp.org';
saveUrlForRedirection(link, DOMAIN);

cy.setUpApi();
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const NAVIGATION_LOAD_PAUSE = 1500;
export const PAGE_LOAD_WAITING_PAUSE = 3000;
export const REQUEST_FAILURE_LOADING_TIME = 1500;
export const FILE_LOADING_PAUSE = 2000;
export const TREE_VIEW_PAUSE = 2000;
export const TREE_VIEW_PAUSE = 1500;
export const ITEM_LOADING_PAUSE = 2000;
export const WEBSOCKETS_DELAY_TIME = 1500;
export const WAIT_FOR_ITEM_TABLE_ROW_TIME = 7000;
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
"@emotion/react": "11.11.1",
"@emotion/styled": "11.11.0",
"@graasp/chatbox": "2.0.0",
"@graasp/query-client": "1.3.2",
"@graasp/query-client": "1.4.1",
"@graasp/sdk": "1.2.0",
"@graasp/translations": "1.18.1",
"@graasp/ui": "3.3.1",
"@mui/icons-material": "5.14.3",
"@mui/lab": "5.0.0-alpha.138",
"@mui/material": "5.14.4",
"@sentry/react": "7.61.1",
"@sentry/tracing": "7.61.1",
"@mui/material": "5.14.5",
"@sentry/react": "7.64.0",
"@sentry/tracing": "7.64.0",
"@uppy/core": "3.3.1",
"@uppy/dashboard": "3.4.2",
"@uppy/drag-drop": "3.0.2",
Expand All @@ -35,13 +35,13 @@
"@uppy/status-bar": "3.2.2",
"@uppy/tus": "3.1.2",
"@uppy/xhr-upload": "3.3.1",
"ag-grid-community": "29.3.3",
"ag-grid-react": "29.3.3",
"ag-grid-community": "29.3.5",
"ag-grid-react": "29.3.5",
"date-fns": "2.30.0",
"filesize": "10.0.8",
"filesize": "10.0.12",
"http-status-codes": "2.2.0",
"immutable": "4.3.1",
"katex": "0.16.7",
"katex": "0.16.8",
"lodash.groupby": "4.6.0",
"lodash.partition": "4.6.0",
"lodash.truncate": "4.4.2",
Expand All @@ -56,8 +56,8 @@
"react-image-crop": "9.1.1",
"react-query": "3.39.3",
"react-quill": "2.0.0",
"react-router": "6.14.2",
"react-router-dom": "6.14.2",
"react-router": "6.15.0",
"react-router-dom": "6.15.0",
"react-toastify": "9.1.3",
"stylis": "4.3.0",
"stylis-plugin-rtl": "2.1.1",
Expand Down Expand Up @@ -104,7 +104,7 @@
"@commitlint/cli": "17.7.1",
"@commitlint/config-conventional": "17.7.0",
"@cypress/code-coverage": "3.11.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@trivago/prettier-plugin-sort-imports": "4.2.0",
Expand All @@ -119,24 +119,24 @@
"@types/react-dom": "18.2.7",
"@types/uuid": "9.0.2",
"@types/validator": "13.11.1",
"@typescript-eslint/eslint-plugin": "6.3.0",
"@typescript-eslint/parser": "6.3.0",
"@typescript-eslint/eslint-plugin": "6.4.0",
"@typescript-eslint/parser": "6.4.0",
"@vitejs/plugin-react": "4.0.4",
"concurrently": "8.2.0",
"cypress": "12.17.3",
"cypress-localstorage-commands": "2.2.3",
"cypress-localstorage-commands": "2.2.4",
"env-cmd": "10.1.0",
"eslint": "^8.46.0",
"eslint": "^8.47.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "9.0.0",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-import-resolver-typescript": "3.6.0",
"eslint-plugin-import": "2.28.0",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-react": "7.33.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"husky": "8.0.3",
"nyc": "15.1.0",
"prettier": "3.0.1",
"prettier": "3.0.2",
"rollup-plugin-visualizer": "5.9.2",
"typescript": "5.1.6",
"vite": "4.4.9",
Expand Down
Loading

0 comments on commit 04a7afb

Please sign in to comment.