Skip to content

Commit

Permalink
fix: remove unused delays
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Oct 9, 2024
1 parent b77c6f3 commit fdff1b8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 35 deletions.
32 changes: 12 additions & 20 deletions cypress/e2e/authentication.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ import { CookieKeys, PackedFolderItemFactory } from '@graasp/sdk';

import {
HOME_PATH,
ITEMS_PATH,
REDIRECT_PATH,
buildItemPath,
} from '../../src/config/paths';
import { HEADER_APP_BAR_ID, ITEM_MAIN_CLASS } from '../../src/config/selectors';
import {
REDIRECTION_TIME,
REQUEST_FAILURE_LOADING_TIME,
} from '../support/constants';
import { REQUEST_FAILURE_LOADING_TIME } from '../support/constants';
import { SIGN_IN_PATH } from '../support/paths';

describe('Authentication', () => {
Expand Down Expand Up @@ -46,29 +42,25 @@ describe('Authentication', () => {
});
});

describe('Redirect to URL in local storage', () => {
describe('Redirect to URL saved in cookie', () => {
it('Home', () => {
cy.setCookie(CookieKeys.RedirectUrl, HOME_PATH);
cy.visit(REDIRECT_PATH);
cy.url({
timeout: REDIRECTION_TIME,
}).should('include', HOME_PATH);
});

it('Items', () => {
cy.setCookie(CookieKeys.RedirectUrl, ITEMS_PATH);
cy.visit(REDIRECT_PATH);
cy.url({
timeout: REDIRECTION_TIME,
}).should('include', ITEMS_PATH);
cy.url().should(
'equal',
new URL(HOME_PATH, Cypress.config().baseUrl).toString(),
);
});

it('Item', () => {
cy.setCookie(CookieKeys.RedirectUrl, buildItemPath(ENV.items[0].id));
cy.visit(REDIRECT_PATH);
cy.url({ timeout: REDIRECTION_TIME }).should(
'include',
buildItemPath(ENV.items[0].id),
cy.url().should(
'equal',
new URL(
buildItemPath(ENV.items[0].id),
Cypress.config().baseUrl,
).toString(),
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/item/chatbox/chatbox.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import {
} from '../../../../src/config/selectors';
import { ITEM_WITH_CHATBOX_MESSAGES } from '../../../fixtures/chatbox';
import { CURRENT_USER, MEMBERS } from '../../../fixtures/members';
import { CHATBOX_LOADING_TIME } from '../../../support/constants';
import { CHATBOX_TIMEOUT } from '../../../support/constants';

const openChatbox = () => {
cy.get(`#${ITEM_CHATBOX_BUTTON_ID}`).click();
cy.wait('@getItemChat', { timeout: CHATBOX_LOADING_TIME });
cy.wait('@getItemChat', { timeout: CHATBOX_TIMEOUT });
};

describe('Chatbox Scenarios', () => {
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/memberships/deleteItemMembership.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from '../../../src/config/selectors';
import { CURRENT_USER, MEMBERS } from '../../fixtures/members';
import { ITEMS_WITH_MEMBERSHIPS } from '../../fixtures/memberships';
import { TABLE_MEMBERSHIP_RENDER_TIME } from '../../support/constants';
import { ItemForTest } from '../../support/types';

const deleteItemMembership = ({
Expand All @@ -26,7 +25,6 @@ const deleteItemMembership = ({
itemId: string;
}) => {
cy.get(`#${buildShareButtonId(itemId)}`).click();
cy.wait(TABLE_MEMBERSHIP_RENDER_TIME);
cy.get(`#${buildItemMembershipRowDeleteButtonId(id)}`).click();
cy.get(`#${CONFIRM_MEMBERSHIP_DELETE_BUTTON_ID}`).click();
};
Expand Down
12 changes: 1 addition & 11 deletions cypress/support/constants.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
export const CREATE_ITEM_PAUSE = 1000;
export const EDIT_ITEM_PAUSE = 1000;
export const ITEM_LOGIN_PAUSE = 1000;
export const NAVIGATE_PAUSE = 1000;
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 = 1500;
export const WEBSOCKETS_DELAY_TIME = 1500;

export const EDIT_TAG_REQUEST_TIMEOUT = 10000;

export const REDIRECTION_CONTENT = 'hello';
export const REQUEST_FAILURE_TIME = 2500;

export const REDIRECTION_TIME = 500;
export const CAPTION_EDIT_PAUSE = 2000;

export const TABLE_MEMBERSHIP_RENDER_TIME = 1000;
export const FIXTURES_THUMBNAILS_FOLDER = './thumbnails';
export const CHATBOX_LOADING_TIME = 5000;
export const CHATBOX_TIMEOUT = 5000;

0 comments on commit fdff1b8

Please sign in to comment.