-
Notifications
You must be signed in to change notification settings - Fork 198
Cache pricing + custom model entry #736
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
Changes from 1 commit
df71f8c
4a1c6df
dbe29da
1a5e217
42a6472
f0115fc
4da4a0f
9d0b4cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,13 +72,19 @@ | |
|
|
||
| async function openOnboarding( | ||
| browser: Browser, | ||
| opts: { source?: boolean; account: AccountState; delayMs?: number }, | ||
| opts: { | ||
| source?: boolean; | ||
| account: AccountState; | ||
| delayMs?: number; | ||
| edition?: string; | ||
| expectOnboarding?: boolean; | ||
| }, | ||
| ): Promise<{ page: Page; close: () => Promise<void> }> { | ||
| const context = await browser.newContext({ | ||
| storageState: "e2e/fixtures/auth/owner.json", | ||
| }); | ||
| await context.addInitScript( | ||
| ([sourceKey, sourceValue, withSource]) => { | ||
| ([sourceKey, sourceValue, withSource, edition]) => { | ||
| try { | ||
| window.localStorage.setItem("netbird-test-onboarding", "true"); | ||
| if (withSource) { | ||
|
|
@@ -87,13 +93,23 @@ | |
| sourceValue as string, | ||
| ); | ||
| } | ||
| if (edition) { | ||
| window.localStorage.setItem("netbird-test-edition", edition as string); | ||
| } | ||
| } catch (e) {} | ||
| }, | ||
| [SIGNUP_SOURCE_KEY, AGENT_NETWORK_SOURCE, !!opts.source] as const, | ||
| [ | ||
| SIGNUP_SOURCE_KEY, | ||
| AGENT_NETWORK_SOURCE, | ||
| !!opts.source, | ||
| opts.edition ?? "", | ||
| ] as const, | ||
| ); | ||
| const page = await context.newPage(); | ||
| mockAccounts(page, opts.account, opts.delayMs ?? 0); | ||
| await loginToApp(page, "owner", { expectOnboarding: true }); | ||
| await loginToApp(page, "owner", { | ||
| expectOnboarding: opts.expectOnboarding ?? true, | ||
| }); | ||
| return { page, close: () => context.close() }; | ||
| } | ||
|
|
||
|
|
@@ -143,6 +159,44 @@ | |
| } | ||
| }); | ||
|
|
||
| test("a self-hosted account with onboarding pending shows the regular flow at the intent step", async ({ | ||
| browser, | ||
| }) => { | ||
| const { page, close } = await openOnboarding(browser, { | ||
| source: false, | ||
| edition: "oss", | ||
| account: { onboardingFlowPending: true }, | ||
| }); | ||
| try { | ||
| await expect(page.getByTestId(REGULAR_FORM)).toBeVisible(); | ||
| await expect(page.getByTestId(AGENT_FORM)).toHaveCount(0); | ||
| // The signup survey relies on a JWT domain claim self-hosted IdPs don't | ||
| // emit, so the flow skips it and opens on the intent step. | ||
| await expect(page.getByText("Get started with NetBird")).toBeVisible(); | ||
|
Check failure on line 175 in e2e/tests/onboarding-form.spec.ts
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '--- target spec around lines 150-190 ---\n'
sed -n '140,190p' e2e/tests/onboarding-form.spec.ts | nl -ba -v140
printf '\n--- relevant selector occurrences in target spec ---\n'
rg -n 'getByText\(|getByTestId\(|Get started with NetBird|intent step|intent' e2e/tests/onboarding-form.spec.ts || true
printf '\n--- getStarted text occurrences in repo ---\n'
rg -n '"?Get started with NetBird"?|Get started with NetBird' . --glob '!node_modules' --glob '!dist' --glob '!build' || trueRepository: netbirdio/dashboard Length of output: 248 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- target spec around lines 150-190 ---'
sed -n '140,190p' e2e/tests/onboarding-form.spec.ts | nl -ba -v140
printf '%s\n' '\n--- relevant selector occurrences in target spec ---'
rg -n 'getByText\(|getByTestId\(|Get started with NetBird|intent step|intent' e2e/tests/onboarding-form.spec.ts || true
printf '%s\n' '\n--- Get started with NetBird occurrences in repo ---'
rg -n 'Get started with NetBird' . --glob '!node_modules' --glob '!dist' --glob '!build' || trueRepository: netbirdio/dashboard Length of output: 238 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- target spec around lines 150-190 ---'
awk '{printf "%5d\t%s\n", NR, $0}' e2e/tests/onboarding-form.spec.ts | sed -n '140,190p'
printf '%s\n' '--- relevant selector occurrences in target spec ---'
rg -n 'getByText\(|getByTestId\(|Get started with NetBird|intent step|intent' e2e/tests/onboarding-form.spec.ts || true
printf '%s\n' '--- Get started with NetBird occurrences in repo ---'
rg -n 'Get started with NetBird' . --glob '!node_modules' --glob '!dist' --glob '!build' || trueRepository: netbirdio/dashboard Length of output: 3835 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- OnboardingIntent.tsx relevant section ---'
awk '{printf "%5d\t%s\n", NR, $0}' src/modules/onboarding/OnboardingIntent.tsx | sed -n '1,140p'
printf '%s\n' '--- current e2e data-testid usage for onboarding/OnboardingIntent ---'
rg -n 'data-testid|byTestId|OnboardingIntent|Get started with NetBird' src/modules/onboarding e2e/tests/onboarding-form.spec.ts | head -n 200Repository: netbirdio/dashboard Length of output: 7474 Use a
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| } finally { | ||
| await close(); | ||
| } | ||
| }); | ||
|
|
||
| test("a self-hosted account with only the signup form pending shows no onboarding", async ({ | ||
| browser, | ||
| }) => { | ||
| const { page, close } = await openOnboarding(browser, { | ||
| source: false, | ||
| edition: "oss", | ||
| account: { signupFormPending: true }, | ||
| expectOnboarding: false, | ||
| }); | ||
| try { | ||
| // loginToApp resolved the dashboard, so the account state has been | ||
| // applied — neither flow should have opened. | ||
| await expect(page.getByTestId(REGULAR_FORM)).toHaveCount(0); | ||
| await expect(page.getByTestId(AGENT_FORM)).toHaveCount(0); | ||
| } finally { | ||
| await close(); | ||
| } | ||
| }); | ||
|
|
||
| test("a slow backend never flashes the regular form for a netbird.ai signup", async ({ | ||
| browser, | ||
| }) => { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.