Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/rspress-plugin-gh-pages/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('rspress-plugin-gh-pages', () => {
test('serves docs from the inferred repository base', async ({ page }) => {
await page.goto(pageUrl('/rspress-plugins/'));

await expect(page).toHaveURL(/\/rspress-plugins\/$/);
await expect(page).toHaveURL(pageUrl('/rspress-plugins/'));
await expect(
page.getByRole('heading', { name: 'RSPress x GH Pages' }),
).toBeVisible();
Expand Down
3 changes: 3 additions & 0 deletions packages/rspress-plugin-gh-pages/rspress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import ghpages from 'rspress-plugin-gh-pages';
export default defineConfig({
root: path.join(import.meta.dirname, 'docs'),
title: 'Rspress x GHPages Example',
route: {
cleanUrls: true,
},
plugins: [
ghpages({
repo: 'https://github.com/linbudu599/rspress-plugins.git',
Expand Down
10 changes: 7 additions & 3 deletions packages/rspress-plugin-google-analytics/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('rspress-plugin-google-analytics', () => {

// Covers injection of Google Analytics connection and loader tags.
test('injects analytics tags for the primary ID', async ({ page }) => {
await page.goto(pageUrl());
await page.goto(pageUrl('/index.html'));

await expect(
page.locator(
Expand All @@ -34,7 +34,11 @@ describe('rspress-plugin-google-analytics', () => {

// Covers multi-ID configuration, IP anonymization, and page-view reporting.
test('configures every ID and reports the page view', async ({ page }) => {
await page.goto(pageUrl());
// Use the canonical index URL for the default cleanUrls: false.
await page.goto(pageUrl('/index.html'));

// Analytics should report the canonical pathname used by the router.
await expect(page).toHaveURL(pageUrl('/index.html'));

await expect
.poll(
Expand All @@ -51,7 +55,7 @@ describe('rspress-plugin-google-analytics', () => {
expect.arrayContaining([
['config', 'G-E2EPRIMARY', { anonymize_ip: true }],
['config', 'G-E2ESECONDARY', { anonymize_ip: true }],
['set', 'page_path', '/'],
['set', 'page_path', '/index.html'],
['event', 'page_view'],
]),
);
Expand Down
Loading