name: Browser tests

on: [push, pull_request]

jobs:
  tests:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: "npm"
      - run: npm install

      - run: npx playwright install chromium
      - name: Unit tests
        uses: coactions/setup-xvfb@v1
        with:
          run: npx vitest run --browser
