diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47b92474..35ae9828 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,3 +76,123 @@ jobs: - name: Fail if visual regressions detected if: steps.visual.outcome == 'failure' run: exit 1 + + dm-unit-tests: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache npm directory + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node-version }}-npm- + + - name: Cache node_modules + id: node-modules-cache + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ matrix.node-version }}-modules-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node-version }}-modules- + + - name: Install dependencies + if: steps.node-modules-cache.outputs.cache-hit != 'true' + run: npm ci + + - name: Run DM unit tests + run: npm run test:dm:unit + + dm-integration-tests: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache npm directory + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node-version }}-npm- + + - name: Cache node_modules + id: node-modules-cache + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ matrix.node-version }}-modules-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node-version }}-modules- + + - name: Install dependencies + if: steps.node-modules-cache.outputs.cache-hit != 'true' + run: npm ci + + - name: Run DM integration tests + run: npm run test:dm:integration + + e2e-headless: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache npm directory + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node-version }}-npm- + + - name: Cache node_modules + id: node-modules-cache + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ matrix.node-version }}-modules-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node-version }}-modules- + + - name: Install dependencies + if: steps.node-modules-cache.outputs.cache-hit != 'true' + run: npm ci + + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + + - name: Run headless E2E tests + run: npm run test:e2e diff --git a/README.md b/README.md index 5de0cf26..109cf05d 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,9 @@ http://localhost:8000 ### Common Commands - **Run unit tests**: `npm run test:unit` +- **Run DM unit tests**: `npm run test:dm:unit` +- **Run DM integration tests**: `npm run test:dm:integration` +- **Run headless E2E tests**: `npm run test:e2e` - **Format code**: `npm run format` - **Lint code**: `npm run lint` @@ -393,10 +396,13 @@ placeholder at “—” and development builds log a warning—so mixed deploym ## Testing -Continuous integration runs CSS linting/builds, the Playwright kitchen-sink snapshots, and the Node-based unit tests on every push. +Continuous integration runs CSS linting/builds, the DM unit/integration suites, the Playwright kitchen-sink snapshots, headless E2E flows, and the Node-based unit tests on every push. Before pushing, run `npm run build` locally so the Tailwind bundle regenerates. Pair that with `npm run test:unit` for application logic changes and `npm run test:visual` for presentation updates to mirror the CI surface area. +For DM-specific changes, also run `npm run test:dm:unit` and +`npm run test:dm:integration` to cover the direct message flows. +Use `npm run test:e2e` to execute the headless Playwright journeys in `tests/e2e`. ### Manual QA checklist diff --git a/components/profile-modal.html b/components/profile-modal.html index 5b19d656..b10ac6e2 100644 --- a/components/profile-modal.html +++ b/components/profile-modal.html @@ -443,6 +443,26 @@ > + +
+ Control when bitvid fetches link preview metadata. Disable auto-fetch to review new domains before previews load. +
++ Monitor connectivity, latency, and errors for your configured relays. +
++ Telemetry is opt-in and only includes relay URLs, latency, and error counts. +
+- View encrypted conversations sent with NIP-04 or NIP-44. bitvid keeps message data on this device only. -
-- Start a new DM or jump to relay preferences before you send. -
-- Select a relay to prioritize encrypted message delivery. -
-- Pause inbound DM sync and clear cached previews on this device. -
-