Skip to content
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

test: improve onboarding test #8121

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading