Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3553c34
feat: create announcements banner
araujogui Feb 20, 2026
67880a8
refactor: review
araujogui Feb 21, 2026
5ef6885
refactor: review
araujogui Feb 21, 2026
eb9a065
feat: update remote config url
araujogui Mar 12, 2026
dc8e10d
refactor: split fetch util
araujogui Mar 12, 2026
76c5612
refactor: simplify
araujogui Mar 21, 2026
9f3fd30
refactor: add version skip comment
araujogui Mar 21, 2026
a01e3d2
fix: cls
araujogui Mar 23, 2026
49b5e25
refactor: transform into hook
araujogui Mar 23, 2026
e3c3aac
feat: set lazy loading
araujogui Mar 23, 2026
f8fd494
refactor: use layout component
araujogui Mar 25, 2026
f5e2a54
feat: separate components
araujogui Mar 25, 2026
03aa57e
refactor: clean loadBanners
araujogui Mar 25, 2026
ebc5431
refactor: split component files
araujogui Mar 30, 2026
3a578c0
test: fix test name
araujogui Mar 30, 2026
85360ab
fix: review
araujogui Mar 30, 2026
1c024c1
chore: remove testing library
araujogui Mar 30, 2026
3a35079
refactor: remove type import
araujogui Mar 31, 2026
a4fe2e1
refactor: inline type import
araujogui Apr 1, 2026
3315e5a
fix: remove duplicated banner
araujogui Apr 2, 2026
fd945cc
fix: web config
araujogui Apr 2, 2026
753aac1
fix: simplify lazy
araujogui Apr 2, 2026
93eaac8
fix: lazy loading
araujogui Apr 2, 2026
8d80dc1
fix: add major version config
araujogui Apr 6, 2026
7a91653
refactor: nit
araujogui Apr 6, 2026
b5d8230
refactor: remove unused type
araujogui Apr 9, 2026
d523a9a
refactor: assign promise
araujogui Apr 10, 2026
bf24092
chore: revert package-lock.json
araujogui Apr 14, 2026
bbf5c11
chore: revert package-lock.json
araujogui Apr 14, 2026
f799ce9
test: set up e2e test
araujogui Apr 14, 2026
0b68e7d
test: create banner test
araujogui Apr 14, 2026
fa73da1
ci: add e2e job
araujogui Apr 14, 2026
8bab1b0
ci: build and serve before testing
araujogui Apr 14, 2026
c78cedb
refactor: add missing curly braces
araujogui Apr 14, 2026
153779b
refactor: pass whole version object
araujogui Apr 14, 2026
0e58c96
chore: add todo issue link
araujogui Apr 14, 2026
da0639c
refactor: inline version label
araujogui Apr 14, 2026
d102547
refactor: restructure component
araujogui Apr 14, 2026
5243f37
refactor: rename to remoteConfigUrl
araujogui Apr 14, 2026
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
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,41 @@ jobs:
with:
files: ./junit.xml
report_type: test_results

e2e:
name: E2E Tests
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Checkout Node.js source
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: nodejs/node
sparse-checkout: doc/api/assert.md
path: node

- name: Build docs
run: npx doc-kit generate -t web -i "./node/doc/api/assert.md" -o out

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Run E2E tests
run: node --run test:e2e
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ isolate-*

# Node's Source Folder
node

# Playwright
playwright-report/
test-results/
66 changes: 66 additions & 0 deletions e2e/announcement-banner.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { expect, test } from '@playwright/test';

const REMOTE_CONFIG_URL = 'https://nodejs.org/site.json';

test.describe('Announcement Banner', () => {
test('renders a text-only banner', async ({ page }) => {
await page.route(REMOTE_CONFIG_URL, route =>
route.fulfill({
contentType: 'application/json',
body: JSON.stringify({
websiteBanners: {
index: { text: 'Important announcement for all users' },
},
}),
})
);

await page.goto('/assert.html');

const banner = page.getByRole('region', { name: 'Announcements' });
await expect(banner).toBeVisible();
await expect(banner).toContainText('Important announcement for all users');
});

test('renders a banner with a link', async ({ page }) => {
await page.route(REMOTE_CONFIG_URL, route =>
route.fulfill({
contentType: 'application/json',
body: JSON.stringify({
websiteBanners: {
index: {
text: 'Read the release notes',
link: 'https://nodejs.org/releases',
},
},
}),
})
);

await page.goto('/assert.html');

const banner = page.getByRole('region', { name: 'Announcements' });
await expect(banner).toBeVisible();

const link = banner.getByRole('link', { name: 'Read the release notes' });
await expect(link).toBeVisible();
await expect(link).toHaveAttribute('href', 'https://nodejs.org/releases');
await expect(link).toHaveAttribute('target', '_blank');
});

test('does not render when there are no active banners', async ({ page }) => {
await page.route(REMOTE_CONFIG_URL, route =>
route.fulfill({
contentType: 'application/json',
body: JSON.stringify({ websiteBanners: {} }),
})
);

await page.goto('/assert.html');
await page.waitForLoadState('networkidle');

await expect(
page.getByRole('region', { name: 'Announcements' })
).not.toBeAttached();
});
});
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineConfig([
ignores: ['out/', 'src/generators/api-links/__tests__/fixtures/'],
},
{
files: ['**/*.{mjs,jsx}'],
files: ['**/*.{mjs,jsx,js}'],
plugins: { jsdoc },
languageOptions: {
ecmaVersion: 'latest',
Expand Down
Loading
Loading