mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-28 17:55:15 +02:00
test: improve onboarding test (#8121)
This commit is contained in:
parent
0fa3738412
commit
152e074c2d
@ -10,7 +10,7 @@ const setupApi = () => {
|
|||||||
testServerRoute(server, '/api/admin/projects/default/api-tokens', {
|
testServerRoute(server, '/api/admin/projects/default/api-tokens', {
|
||||||
tokens: [
|
tokens: [
|
||||||
{
|
{
|
||||||
environment: 'development',
|
environment: 'production',
|
||||||
type: 'client',
|
type: 'client',
|
||||||
secret: 'default:development.5c4150866d',
|
secret: 'default:development.5c4150866d',
|
||||||
},
|
},
|
||||||
@ -24,7 +24,7 @@ const setupApi = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
test('Onboarding for SDK with existing key', async () => {
|
test('Onboarding for SDK', async () => {
|
||||||
setupApi();
|
setupApi();
|
||||||
// on smaller screens we don't show concepts definitions
|
// on smaller screens we don't show concepts definitions
|
||||||
resizeScreen(2000);
|
resizeScreen(2000);
|
||||||
@ -34,7 +34,7 @@ test('Onboarding for SDK with existing key', async () => {
|
|||||||
project='default'
|
project='default'
|
||||||
onClose={() => {}}
|
onClose={() => {}}
|
||||||
open={true}
|
open={true}
|
||||||
environments={['development', 'productions']}
|
environments={['development', 'production']}
|
||||||
feature='featureA'
|
feature='featureA'
|
||||||
/>,
|
/>,
|
||||||
);
|
);
|
||||||
@ -51,7 +51,13 @@ test('Onboarding for SDK with existing key', async () => {
|
|||||||
screen.getByText('API Key');
|
screen.getByText('API Key');
|
||||||
screen.getByText('Flags live in projects');
|
screen.getByText('Flags live in projects');
|
||||||
screen.getByText('development');
|
screen.getByText('development');
|
||||||
|
await screen.findByText('Generate API Key');
|
||||||
|
|
||||||
|
const envWithoutKey = screen.getByText('development');
|
||||||
|
fireEvent.click(envWithoutKey);
|
||||||
|
|
||||||
|
const envWithKey = screen.getByText('production');
|
||||||
|
fireEvent.click(envWithKey);
|
||||||
await screen.findByText('The API key secret');
|
await screen.findByText('The API key secret');
|
||||||
await screen.findByText('5c4150866d');
|
await screen.findByText('5c4150866d');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user