From b4bbca673890375c1faa5eafa3a3b9dc4fbf9249 Mon Sep 17 00:00:00 2001 From: LinaYahya Date: Thu, 20 Jun 2024 13:55:17 +0200 Subject: [PATCH] fix: fix builder test --- cypress/e2e/builder/main.cy.ts | 15 ++++++++------- src/config/selectors.ts | 2 ++ src/modules/builder/configuration/index.tsx | 3 ++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/builder/main.cy.ts b/cypress/e2e/builder/main.cy.ts index 8965659..1de51d0 100644 --- a/cypress/e2e/builder/main.cy.ts +++ b/cypress/e2e/builder/main.cy.ts @@ -1,23 +1,24 @@ import { Context, PermissionLevel } from '@graasp/sdk'; -import { BUILDER_VIEW_CY, buildDataCy } from '../../../src/config/selectors'; +import { + BUILDER_VIEW_CY, + CONFIGURATION_TAB_ID, + buildDataCy, +} from '../../../src/config/selectors'; describe('Builder View', () => { beforeEach(() => { cy.setUpApi( {}, { - context: Context.Builder, - permission: PermissionLevel.Read, + context: Context.Analytics, + permission: PermissionLevel.Admin, }, ); cy.visit('/'); }); it('App', () => { - cy.get(buildDataCy(BUILDER_VIEW_CY)).should( - 'contain.text', - 'Builder as read', - ); + cy.get(`#${CONFIGURATION_TAB_ID}`).should('be.visible'); }); }); diff --git a/src/config/selectors.ts b/src/config/selectors.ts index 686e2e7..a9a0d25 100644 --- a/src/config/selectors.ts +++ b/src/config/selectors.ts @@ -8,3 +8,5 @@ export const buildDataCy = (selector: string): string => export const DESCRIPTION_INPUT_ID = 'description-input-id'; export const DASHBOARD_UPLOADER_ID = 'dashboard-uploader-id'; + +export const CONFIGURATION_TAB_ID = 'configurations-id'; diff --git a/src/modules/builder/configuration/index.tsx b/src/modules/builder/configuration/index.tsx index a9bc02c..e139fc6 100644 --- a/src/modules/builder/configuration/index.tsx +++ b/src/modules/builder/configuration/index.tsx @@ -5,6 +5,7 @@ import { Stack, Step, StepButton, Stepper } from '@mui/material'; import { SettingsKeys } from '@/@types'; import { useAppTranslation } from '@/config/i18n'; import { hooks } from '@/config/queryClient'; +import { CONFIGURATION_TAB_ID } from '@/config/selectors'; import { APP } from '@/langs/constants'; import AddImageStep from './AddImageStep'; @@ -35,7 +36,7 @@ const Configurations = (): JSX.Element => { ]; return ( - + {steps.map(({ label, disabled }, index) => (