diff --git a/packages/gitbook/e2e/pages.spec.ts b/packages/gitbook/e2e/pages.spec.ts index b61dbbc20..a1303aadc 100644 --- a/packages/gitbook/e2e/pages.spec.ts +++ b/packages/gitbook/e2e/pages.spec.ts @@ -3,6 +3,7 @@ import { CustomizationHeaderPreset, CustomizationIconsStyle, CustomizationLocale, + PublishedSiteContentLookup, SiteCustomizationSettings, } from '@gitbook/api'; import { test, expect, Page } from '@playwright/test'; @@ -763,6 +764,32 @@ const testCases: TestsCase[] = [ }, ], }, + { + name: 'open.gitbook.com', + baseUrl: 'https://open.gitbook.com/', + tests: [ + { + name: 'GitBook Docs', + url: await (async () => { + const res = await fetch( + `https://api.gitbook.com/v1/urls/published?url=https://docs.gitbook.com`, + ); + + if (!res.ok) { + throw new Error('Failed to get published URL'); + } + + const published = await res.json(); + if (!('site' in published)) { + throw new Error('Expected site for published URL'); + } + + return `~site/${published.site}?token=${published.apiToken}`; + })(), + run: waitForCookiesDialog, + }, + ], + }, ]; for (const testCase of testCases) {