test(e2e): align specs with the community edition and record the e2e baseline
The first full e2e run on this branch failed 19 tests, all on features the community edition removed: /api/tier, Stripe, /api/compliance, the billing settings tab, the payment pages and the upgrade dialog. Those checks now assert that the endpoints and pages are gone (404); tier, billing and team-settings probes are dropped from the remaining journeys. The rerun is 410 passed, 18 skipped, 0 failed.
This commit is contained in:
@@ -25,15 +25,6 @@ async function skipOnboarding(page: Page) {
|
||||
});
|
||||
}
|
||||
|
||||
async function setTier(tier: string) {
|
||||
const res = await fetch(`${API}/api/tier`, {
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ tier }),
|
||||
});
|
||||
return res.ok;
|
||||
}
|
||||
|
||||
async function waitForApp(page: Page) {
|
||||
await page.waitForSelector(
|
||||
'.waggle-app-shell, .waggle-sidebar, [role="navigation"], [class*="onboarding"]',
|
||||
@@ -74,70 +65,6 @@ test.describe('Phase 1 — Backend Fixes', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// ── Phase 2: Tier Gating ──────────────────────────────────────────────────
|
||||
|
||||
test.describe('Phase 2 — Tier Gating', () => {
|
||||
test('FREE: Mission Control shows lock overlay', async ({ page }) => {
|
||||
await setTier('FREE');
|
||||
await skipOnboarding(page);
|
||||
await page.goto(`${API}`);
|
||||
await waitForApp(page);
|
||||
|
||||
// Navigate to Mission Control
|
||||
const mcButton = page.locator('button', { hasText: 'Mission Control' });
|
||||
if (await mcButton.isVisible({ timeout: 5000 }).catch(() => false)) {
|
||||
await mcButton.click();
|
||||
// Should see lock overlay
|
||||
const lockOverlay = page.locator('text=Upgrade to Teams');
|
||||
await expect(lockOverlay).toBeVisible({ timeout: 5000 }).catch(() => {
|
||||
// LockedFeature renders blurred content with upgrade card
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
test('FREE: sidebar shows lock icon on Mission Control', async ({ page }) => {
|
||||
await setTier('FREE');
|
||||
await skipOnboarding(page);
|
||||
await page.goto(`${API}`);
|
||||
await waitForApp(page);
|
||||
|
||||
// Check for lock icon near Mission Control
|
||||
const mcNav = page.locator('button[title*="Mission Control"]');
|
||||
if (await mcNav.isVisible({ timeout: 5000 }).catch(() => false)) {
|
||||
const title = await mcNav.getAttribute('title');
|
||||
expect(title).toContain('requires Teams');
|
||||
}
|
||||
});
|
||||
|
||||
test('FREE: /spawn not in command palette', async ({ page }) => {
|
||||
await setTier('FREE');
|
||||
await skipOnboarding(page);
|
||||
await page.goto(`${API}`);
|
||||
await waitForApp(page);
|
||||
|
||||
// Open command palette with Ctrl+K
|
||||
await page.keyboard.press('Control+k');
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Check if /spawn is hidden
|
||||
const spawnItem = page.locator('text=/spawn');
|
||||
const isVisible = await spawnItem.isVisible({ timeout: 2000 }).catch(() => false);
|
||||
// On FREE, /spawn should not be visible
|
||||
if (isVisible) {
|
||||
// If command palette didn't open or render differently, just log
|
||||
test.info().annotations.push({ type: 'note', description: '/spawn visibility check — palette may not have opened' });
|
||||
}
|
||||
});
|
||||
|
||||
test('tier endpoint returns valid tier', async () => {
|
||||
const res = await fetch(`${API}/api/tier`);
|
||||
expect(res.ok).toBeTruthy();
|
||||
const data = await res.json();
|
||||
expect(['TRIAL', 'FREE', 'TEAMS', 'ENTERPRISE']).toContain(data.tier);
|
||||
expect(data.capabilities).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
// ── Phase 3: UX Fixes ────────────────────────────────────────────────────
|
||||
|
||||
test.describe('Phase 3 — UX Fixes', () => {
|
||||
|
||||
Reference in New Issue
Block a user