Skip to content

Commit

Permalink
fix: migrations e2e test (#8965)
Browse files Browse the repository at this point in the history
Onboarding changed e2e test that should run before migration.
  • Loading branch information
Tymek authored Dec 12, 2024
1 parent 7a43634 commit 828ecf8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions frontend/cypress/oss/feature/feature.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ describe('feature', () => {

it('can create a feature flag', () => {
cy.createFeature_UI(featureToggleName, true, 'default', true);
cy.contains('a', featureToggleName).click();
cy.url().should('include', featureToggleName);
});
});
1 change: 1 addition & 0 deletions frontend/cypress/support/UI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const createFeature_UI = (
const projectName = project || 'default';
const uiOpts = forceInteractions ? { force: true } : undefined;
cy.visit(`/projects/${projectName}`);

cy.get('[data-testid=NAVIGATE_TO_CREATE_FEATURE').click(uiOpts);

cy.intercept('POST', `/api/admin/projects/${projectName}/features`).as(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { CreateFeatureDialog } from './CreateFeatureDialog';
import IosShare from '@mui/icons-material/IosShare';
import type { OverridableStringUnion } from '@mui/types';
import type { ButtonPropsVariantOverrides } from '@mui/material/Button/Button';
import { NAVIGATE_TO_CREATE_FEATURE } from 'utils/testIds';

interface IProjectFeatureTogglesHeaderProps {
isLoading?: boolean;
Expand All @@ -46,6 +47,7 @@ interface IFlagCreationButtonProps {
ButtonPropsVariantOverrides
>;
skipNavigationOnComplete?: boolean;
isLoading?: boolean;
onSuccess?: () => void;
}

Expand All @@ -57,6 +59,7 @@ export const FlagCreationButton = ({
variant,
text = 'New feature flag',
skipNavigationOnComplete,
isLoading,
onSuccess,
}: IFlagCreationButtonProps) => {
const { loading } = useUiConfig();
Expand All @@ -72,10 +75,12 @@ export const FlagCreationButton = ({
maxWidth='960px'
Icon={Add}
projectId={projectId}
disabled={loading}
disabled={loading || isLoading}
variant={variant}
permission={CREATE_FEATURE}
data-testid='NAVIGATE_TO_CREATE_FEATURE'
data-testid={
loading || isLoading ? '' : NAVIGATE_TO_CREATE_FEATURE
}
>
{text}
</StyledResponsiveButton>
Expand Down Expand Up @@ -207,7 +212,7 @@ export const ProjectFeatureTogglesHeader: FC<
</Button>
}
/>
<FlagCreationButton />
<FlagCreationButton isLoading={isLoading} />
</>
}
>
Expand Down

0 comments on commit 828ecf8

Please sign in to comment.