PromucFlow_constructor/app/client/cypress/support/Objects/FeatureFlags.ts
Hetu Nandu 87b60908a4
chore: Stub /features call in tests (#25104)
This change will stub the call to `users/features` to get the feature
flags. By default it will return an empty list and rely on the client
default flag list to enable/disable features
2023-07-05 19:39:04 +05:30

18 lines
327 B
TypeScript

export const featureFlagIntercept = (
flags: Record<string, boolean>,
reload = true,
) => {
const response = {
responseMeta: {
status: 200,
success: true,
},
data: flags,
errorDisplay: "",
};
cy.intercept("GET", "/api/v1/users/features", response);
if (reload) {
cy.reload();
}
};