Skip to content

Commit

Permalink
fix: fix builder test
Browse files Browse the repository at this point in the history
  • Loading branch information
LinaYahya committed Jun 20, 2024
1 parent 9b4d4d5 commit b4bbca6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
15 changes: 8 additions & 7 deletions cypress/e2e/builder/main.cy.ts
Original file line number Diff line number Diff line change
@@ -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');
});
});
2 changes: 2 additions & 0 deletions src/config/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
3 changes: 2 additions & 1 deletion src/modules/builder/configuration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -35,7 +36,7 @@ const Configurations = (): JSX.Element => {
];

return (
<Stack spacing={1}>
<Stack spacing={1} id={CONFIGURATION_TAB_ID}>
<Stepper activeStep={activeStep} nonLinear>
{steps.map(({ label, disabled }, index) => (
<Step key={label}>
Expand Down

0 comments on commit b4bbca6

Please sign in to comment.