From c549280e318a09031bff884f148ba122e03c2a01 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Wed, 9 Aug 2023 12:58:03 +0200 Subject: [PATCH] fix: Performance improvements for demo and docs update (#4454) --- .../changeRequest/ChangeRequestPermissions.test.tsx | 12 ++++++++++++ frontend/src/component/demo/demo-topics.tsx | 11 +++++------ .../FeatureOverviewEnvironment.tsx | 1 + ...ure-strategy-variants.md => strategy-variants.md} | 6 +++--- website/sidebars.js | 2 +- 5 files changed, 22 insertions(+), 10 deletions(-) rename website/docs/reference/{feature-strategy-variants.md => strategy-variants.md} (97%) diff --git a/frontend/src/component/changeRequest/ChangeRequestPermissions.test.tsx b/frontend/src/component/changeRequest/ChangeRequestPermissions.test.tsx index c7c9e37e61..a53f14a7be 100644 --- a/frontend/src/component/changeRequest/ChangeRequestPermissions.test.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestPermissions.test.tsx @@ -266,6 +266,12 @@ const copyButtonsActiveInOtherEnv = async () => { expect(customEnvStrategyCopyButton).not.toBeDisabled(); }; +const openEnvironments = async (envNames: string[]) => { + for (const env of envNames) { + (await screen.findAllByText(env))[1].click(); + } +}; + test('open mode + non-project member can perform basic change request actions', async () => { const project = 'default'; const featureName = 'test'; @@ -289,6 +295,8 @@ test('open mode + non-project member can perform basic change request actions', ); + await openEnvironments(['development', 'production', 'custom']); + await strategiesAreDisplayed('UserIDs', 'Standard'); await deleteButtonsActiveInChangeRequestEnv(); await copyButtonsActiveInOtherEnv(); @@ -317,6 +325,8 @@ test('protected mode + project member can perform basic change request actions', ); + await openEnvironments(['development', 'production', 'custom']); + await strategiesAreDisplayed('UserIDs', 'Standard'); await deleteButtonsActiveInChangeRequestEnv(); await copyButtonsActiveInOtherEnv(); @@ -345,6 +355,8 @@ test('protected mode + non-project member cannot perform basic change request ac ); + await openEnvironments(['development', 'production', 'custom']); + await strategiesAreDisplayed('UserIDs', 'Standard'); await deleteButtonsInactiveInChangeRequestEnv(); await copyButtonsActiveInOtherEnv(); diff --git a/frontend/src/component/demo/demo-topics.tsx b/frontend/src/component/demo/demo-topics.tsx index a45f74724c..79c1baef4b 100644 --- a/frontend/src/component/demo/demo-topics.tsx +++ b/frontend/src/component/demo/demo-topics.tsx @@ -429,19 +429,18 @@ export const TOPICS: ITutorialTopic[] = [ <> - Feature toggle variants + Strategy variants {' '} - allow you to define different values for a feature - toggle. They can be used for A/B testing or + allow you to define different values for a matching + strategy. They can be used for A/B testing or segmenting your users. - Let's try adding a variant to a feature toggle, - along with an override so our user can see it. + Let's try adding a variant to a strategy. ), diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx index 23727d4c3c..b6843a3638 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx @@ -141,6 +141,7 @@ const FeatureOverviewEnvironment = ({ show={