-
-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create project upgrade link (#8822)
- Loading branch information
Showing
3 changed files
with
106 additions
and
26 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
frontend/src/component/common/PremiumFeature/PremiumFeature.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { render } from 'utils/testRenderer'; | ||
import { screen } from '@testing-library/react'; | ||
import { PremiumFeature } from './PremiumFeature'; | ||
|
||
test('Show plans comparison message and link by default - with tooltip', async () => { | ||
render(<PremiumFeature feature='environments' tooltip={true} />); | ||
|
||
const link = screen.getByText('Compare plans'); | ||
|
||
expect(link).toHaveAttribute( | ||
'href', | ||
'https://www.getunleash.io/plans?feature=environments', | ||
); | ||
}); | ||
|
||
test('Show plans comparison message and link by default - without tooltip', async () => { | ||
render(<PremiumFeature feature='environments' tooltip={false} />); | ||
|
||
const link = screen.getByText('Compare plans'); | ||
|
||
expect(link).toHaveAttribute( | ||
'href', | ||
'https://www.getunleash.io/plans?feature=environments', | ||
); | ||
}); | ||
|
||
test('Show upgrade message and link - with tooltip', async () => { | ||
render( | ||
<PremiumFeature feature='environments' tooltip={true} mode='upgrade' />, | ||
); | ||
|
||
const link = screen.getByText('View our Enterprise offering'); | ||
|
||
expect(link).toHaveAttribute( | ||
'href', | ||
'https://www.getunleash.io/upgrade_unleash?utm_source=environments', | ||
); | ||
}); | ||
|
||
test('Show upgrade message and link - without tooltip', async () => { | ||
render( | ||
<PremiumFeature | ||
feature='environments' | ||
tooltip={false} | ||
mode='upgrade' | ||
/>, | ||
); | ||
|
||
const link = screen.getByText('View our Enterprise offering'); | ||
|
||
expect(link).toHaveAttribute( | ||
'href', | ||
'https://www.getunleash.io/upgrade_unleash?utm_source=environments', | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters