Skip to content

Test/component test#449

Open
MaryChen68 wants to merge 6 commits into
mainfrom
test/component-test
Open

Test/component test#449
MaryChen68 wants to merge 6 commits into
mainfrom
test/component-test

Conversation

@MaryChen68

Copy link
Copy Markdown
Contributor

Render both components in isolation with jsdom + Testing Library and assert
their DOM output by feeding props:

  • ChatMessage: user/assistant alignment branches, content rendering, markdown
    rendered as strong
  • Navbar: all tab buttons render, defaults to Draft, clicking switches
    pageNameAtom (also covers the pageContext atom transition)

Comment on lines +27 to +41
name: Unit tests (Vitest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm test

e2e:
Comment on lines +42 to +66
name: E2E tests (Playwright)
timeout-minutes: 60
runs-on: ubuntu-latest
# Pinned to match the installed @playwright/test version (1.60.0); bump both
# together so the committed visual snapshots keep matching.
container:
image: mcr.microsoft.com/playwright:v1.60.0-noble
options: --user 1001
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Build Frontend
run: npm run build
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: playwright-report
path: frontend/playwright-report/
retention-days: 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants