-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore(flags): rm feature flag cta from FE #101015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @@ -0,0 +1,118 @@ | |||
| import {Fragment, useEffect} from 'react'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file was just renamed from the inline CTA file, but now it exports the FeatureFlagCTAContent component by default
| it('renders cta if event.contexts.flags is not set and should show cta', async () => { | ||
| const org = OrganizationFixture({features: ['feature-flag-cta']}); | ||
| it('renders empty state if event.contexts.flags is not set - flags already sent', () => { | ||
| const org = OrganizationFixture({features: []}); | ||
|
|
||
| render(<EventFeatureFlagSection {...NO_FLAG_CONTEXT_SECTION_PROPS_CTA} />, { | ||
| render(<EventFeatureFlagSection {...NO_FLAG_CONTEXT_WITH_FLAGS_SECTION_PROPS} />, { | ||
| organization: org, | ||
| }); | ||
|
|
||
| const control = screen.queryByRole('button', {name: 'Sort Flags'}); | ||
| expect(control).not.toBeInTheDocument(); | ||
| const search = screen.queryByRole('button', {name: 'Open Feature Flag Search'}); | ||
| expect(search).not.toBeInTheDocument(); | ||
| expect( | ||
| screen.queryByRole('button', {name: 'Set Up Integration'}) | ||
| ).not.toBeInTheDocument(); | ||
|
|
||
| // wait for the CTA to be rendered | ||
| expect(await screen.findByText('Set Up Feature Flags')).toBeInTheDocument(); | ||
| expect(screen.getByText('Feature Flags')).toBeInTheDocument(); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test is not needed
| it('renders nothing if event.contexts.flags is not set and should not show cta - no feature flag', async () => { | ||
| const org = OrganizationFixture({features: ['fake-feature-flag']}); | ||
| it('renders nothing if event.contexts.flags is not set - wrong platform', () => { | ||
| const org = OrganizationFixture({features: []}); | ||
|
|
||
| render(<EventFeatureFlagSection {...NO_FLAG_CONTEXT_SECTION_PROPS_CTA} />, { | ||
| render(<EventFeatureFlagSection {...NO_FLAG_CONTEXT_SECTION_PROPS} />, { | ||
| organization: org, | ||
| }); | ||
|
|
||
| const control = screen.queryByRole('button', {name: 'Sort Flags'}); | ||
| expect(control).not.toBeInTheDocument(); | ||
| const search = screen.queryByRole('button', {name: 'Open Feature Flag Search'}); | ||
| expect(search).not.toBeInTheDocument(); | ||
| expect( | ||
| screen.queryByRole('button', {name: 'Set Up Integration'}) | ||
| ).not.toBeInTheDocument(); | ||
|
|
||
| // CTA should not appear | ||
| await waitFor(() => { | ||
| expect(screen.queryByText('Set Up Feature Flags')).not.toBeInTheDocument(); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed
rm the feature flag CTA (was only ever shown to LD users)
rm the feature flag CTA (was only ever shown to LD users)