Skip to content

Commit

Permalink
Revise what pages are build on CI. Make all demo pages available.
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Sep 21, 2023
1 parent 47f0018 commit 37efa39
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
34 changes: 20 additions & 14 deletions packages/dnb-design-system-portal/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,26 @@ exports.onCreatePage = ({ page, actions }) => {
// Only build pages without "'/uilib'" when building for visual tests
if (process.env.IS_VISUAL_TEST === '1') {
if (
(page.path !== '/' &&
!existsInPages(page.path, [
'/404',
'/500',
'/uilib',
'/quickguide-designer/colors',
'/quickguide-designer/fonts',
'/contribute/getting-started',
])) ||
existsInPages(page.path, ['/forms/']) ||
existsInPages(page.componentPath, [
'properties.mdx',
'events.mdx',
'info.mdx',
page.path !== '/' &&
!existsInPages(page.path, [
// General pages
'/404',
'/500',

// Playwright e2e tests
'/uilib',
'/uilib/components/button',
'/uilib/components',
'/uilib/extensions',
'/uilib/elements',
'/quickguide-designer/colors',
'/quickguide-designer/fonts',
'/contribute/getting-started',
]) &&
!existsInPages(page.componentPath, [
// Visual e2e tests
'visual-tests',
'demos.mdx',
])
) {
deletedPages.push(page.path)
Expand Down
6 changes: 4 additions & 2 deletions packages/dnb-design-system-portal/src/e2e/fullscreen.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test'

test.describe('Fullscreen', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/uilib/components/button')
await page.goto('/uilib/components/button/demos')
})

test('click on fullscreen button should navigate to the fullscreen page', async ({
Expand All @@ -17,6 +17,8 @@ test.describe('Fullscreen', () => {
})

const currentURL = page.url()
expect(currentURL).toContain('/uilib/components/button/?fullscreen')
expect(currentURL).toContain(
'/uilib/components/button/demos/?fullscreen',
)
})
})

0 comments on commit 37efa39

Please sign in to comment.