Skip to content

Commit

Permalink
test: improve onboarding test (#8121)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored Sep 6, 2024
1 parent 0fa3738 commit 152e074
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions frontend/src/component/onboarding/Onboarding.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const setupApi = () => {
testServerRoute(server, '/api/admin/projects/default/api-tokens', {
tokens: [
{
environment: 'development',
environment: 'production',
type: 'client',
secret: 'default:development.5c4150866d',
},
Expand All @@ -24,7 +24,7 @@ const setupApi = () => {
});
};

test('Onboarding for SDK with existing key', async () => {
test('Onboarding for SDK', async () => {
setupApi();
// on smaller screens we don't show concepts definitions
resizeScreen(2000);
Expand All @@ -34,7 +34,7 @@ test('Onboarding for SDK with existing key', async () => {
project='default'
onClose={() => {}}
open={true}
environments={['development', 'productions']}
environments={['development', 'production']}
feature='featureA'
/>,
);
Expand All @@ -51,7 +51,13 @@ test('Onboarding for SDK with existing key', async () => {
screen.getByText('API Key');
screen.getByText('Flags live in projects');
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('5c4150866d');

Expand Down

0 comments on commit 152e074

Please sign in to comment.