Yuki Takei 3 лет назад
Родитель
Сommit
16b17fab4e
1 измененных файлов с 1 добавлено и 19 удалено
  1. 1 19
      packages/app/test/cypress/support/commands.ts

+ 1 - 19
packages/app/test/cypress/support/commands.ts

@@ -54,30 +54,12 @@ Cypress.Commands.add('waitUntilSpinnerDisappear', () => {
   cy.get('.fa-spinner').should('not.exist');
 });
 
-let isSidebarCollapsed: boolean | undefined;
-
-Cypress.Commands.add('collapseSidebar', (isCollapsed, force=false) => {
-
-  if (!force && isSidebarCollapsed === isCollapsed) {
-    return;
-  }
-
-  const isGrowiPage = Cypress.$('div.growi').length > 0;
-  if (!isGrowiPage) {
-    cy.visit('/page-to-toggle-sidebar-collapsed');
-  }
-
+Cypress.Commands.add('collapseSidebar', (isCollapsed) => {
   cy.getByTestid('grw-contextual-navigation-sub').then(($contents) => {
     const isCurrentCollapsed = $contents.hasClass('d-none');
     // toggle when the current state and isCoolapsed is not match
     if (isCurrentCollapsed !== isCollapsed) {
       cy.getByTestid("grw-navigation-resize-button").click({force: true});
-
-      // wait until saving UserUISettings
-      // eslint-disable-next-line cypress/no-unnecessary-waiting
-      cy.wait(1500);
     }
   });
-
-  isSidebarCollapsed = isCollapsed;
 });