Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ jobs:
- run: pnpm test
env:
KLIPY_API_KEY: ${{ secrets.KLIPY_API_KEY }}
- run: pnpm exec playwright install --with-deps chromium
- run: pnpm run test:browser
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ distribution
.agents/
.claude/
skills-lock.json

/.idea
package-lock.json

test-results/
playwright-report/
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ pnpm run build # Output goes to distribution/
pnpm run watch # Rebuild on file changes
```

### Browser tests

The browser tests cover slash commands and existing toolbar insertion with mocked storage and GIF responses.

```sh
pnpm exec playwright install chromium
pnpm run test:browser
```

### Project layout

| Path | Purpose |
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"lint:js": "eslint .",
"lint:css": "stylelint src/**/*.css",
"fix": "eslint . --fix",
"test": "run-s lint build"
"test": "run-s lint build",
"test:browser": "webpack && playwright test"
},
"browserslist": [
"last 1 Chrome version",
Expand Down Expand Up @@ -59,6 +60,7 @@
"@parcel/transformer-postcss": "^2.0.0-nightly.599",
"@parcel/transformer-posthtml": "^2.0.0-nightly.598",
"@parcel/transformer-webextension": "^2.12.0",
"@playwright/test": "1.63.0",
"babel-loader": "^10.0.0",
"copy-webpack-plugin": "^13.0.0",
"css-loader": "^7.1.2",
Expand Down
12 changes: 12 additions & 0 deletions playwright.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import process from 'node:process';
import { defineConfig } from '@playwright/test';

export default defineConfig({
testDir: './tests',
forbidOnly: Boolean(process.env.CI),
workers: 1,
reporter: 'list',
use: {
viewport: { width: 1280, height: 800 },
},
});
28 changes: 28 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import browser from 'webextension-polyfill';
const defaultSettings = {
useCollapsibleGifs: false,
giphyApiKey: '',
enableSlashCommand: false,
};

/**
Expand Down
Loading