-
Notifications
You must be signed in to change notification settings - Fork 8
Rich unit tests #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
75dfe14
Add settings and help modal visibility management to UIStore
hh54188 fdf172d
Remove ForceConfigModal README documentation as the component is no l…
hh54188 77fb5cb
Enhance SettingsModal with accessibility improvements
hh54188 5207ed3
Refactor SettingsModal for improved user experience and validation
hh54188 8ca98d0
Update package dependencies in chrome-extension
hh54188 e2f4c01
Enhance E2E test environment setup and ESLint configuration
hh54188 197ac39
Add clipboardy dependency and enhance E2E test scripts
hh54188 508fb87
Remove outdated E2E test documentation files
hh54188 bc363a7
Add drag-drop E2E test script to package.json
hh54188 b6f5a5c
Enhance E2E test configuration in vitest.config.js
hh54188 e01ba6e
Remove E2E test workflow from GitHub Actions
hh54188 da06071
Update E2E test workflow and enhance environment variable handling
hh54188 e9dd5e4
Merge branch 'rich-unit-tests' of github.com:hh54188/ai-assistant-chr…
hh54188 d676563
Remove E2E test workflow from GitHub Actions
hh54188 d2eb79e
Remove test-pipeline.yml workflow from GitHub Actions
hh54188 9b481a8
Add dotenv dependency and improve test setup
hh54188 d73a03c
Refactor CI pipeline by removing unnecessary unit test steps and sens…
hh54188 59b2087
Enhance CI pipeline and E2E test configuration
hh54188 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,263 @@ | ||
| name: CI Pipeline | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| branches: [ master ] | ||
| push: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| # Unit Tests for Chrome Extension | ||
| unit-tests: | ||
| name: Unit Tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| cache: 'npm' | ||
| cache-dependency-path: chrome-extension/package-lock.json | ||
|
|
||
| - name: Install Chrome Extension dependencies | ||
| working-directory: ./chrome-extension | ||
| run: npm ci | ||
|
|
||
| - name: Build Chrome Extension | ||
| working-directory: ./chrome-extension | ||
| run: npm run build | ||
|
|
||
| - name: Run Unit Tests (Components) | ||
| working-directory: ./chrome-extension | ||
| run: npm run test:components | ||
|
|
||
| - name: Run Unit Tests (Stores) | ||
| working-directory: ./chrome-extension | ||
| run: npm run test:stores | ||
|
|
||
| - name: Run Unit Tests (All) | ||
| working-directory: ./chrome-extension | ||
| run: npm run test | ||
|
|
||
| - name: Generate Test Coverage | ||
| working-directory: ./chrome-extension | ||
| run: npm run test:coverage | ||
|
|
||
| - name: Upload Coverage Reports | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| file: ./chrome-extension/coverage/lcov.info | ||
| flags: unit-tests | ||
| name: chrome-extension-coverage | ||
|
|
||
| # Backend Tests | ||
| # backend-tests: | ||
| # name: Backend Tests | ||
| # runs-on: ubuntu-latest | ||
|
|
||
| # steps: | ||
| # - name: Checkout code | ||
| # uses: actions/checkout@v4 | ||
|
|
||
| # - name: Setup Node.js | ||
| # uses: actions/setup-node@v4 | ||
| # with: | ||
| # node-version: '18' | ||
| # cache: 'npm' | ||
| # cache-dependency-path: backend/package-lock.json | ||
|
|
||
| # - name: Install Backend dependencies | ||
| # working-directory: ./backend | ||
| # run: npm ci | ||
|
|
||
| # - name: Run Backend Tests | ||
| # working-directory: ./backend | ||
| # env: | ||
| # GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| # NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }} | ||
| # FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }} | ||
| # NODE_ENV: test | ||
| # PORT: 3001 | ||
| # run: | | ||
| # # Run individual test files since there's no test script in backend package.json | ||
| # node tests/test-gemini-conversation-tokens.js | ||
| # node tests/test-gemini-token-counting.js | ||
| # node tests/test-base64-image-upload.js | ||
| # node tests/test-file-attachments.js | ||
| # node tests/test-chat-sessions.js | ||
|
|
||
| # E2E Tests | ||
| e2e-tests: | ||
| name: E2E Tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| cache: 'npm' | ||
| cache-dependency-path: | | ||
| chrome-extension/package-lock.json | ||
| backend/package-lock.json | ||
|
|
||
| - name: Install Chrome Extension dependencies | ||
| working-directory: ./chrome-extension | ||
| run: npm ci | ||
|
|
||
| - name: Install Backend dependencies | ||
| working-directory: ./backend | ||
| run: npm ci | ||
|
|
||
| - name: Build Chrome Extension for E2E | ||
| working-directory: ./chrome-extension | ||
| run: npm run build | ||
|
|
||
| - name: Install Puppeteer dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y wget gnupg | ||
| wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | ||
| echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list | ||
| sudo apt-get update | ||
| sudo apt-get install -y google-chrome-stable | ||
|
|
||
| - name: Run E2E Tests - Gemini Chat | ||
| working-directory: ./chrome-extension | ||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }} | ||
| FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }} | ||
| NODE_ENV: test | ||
| CI: true | ||
| GITHUB_ACTIONS: true | ||
| run: npm run test:e2e:chat | ||
|
|
||
| - name: Run E2E Tests - Image Upload | ||
| working-directory: ./chrome-extension | ||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }} | ||
| FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }} | ||
| NODE_ENV: test | ||
| CI: true | ||
| GITHUB_ACTIONS: true | ||
| run: npm run test:e2e:image | ||
|
|
||
| - name: Run E2E Tests - Drag and Drop | ||
| working-directory: ./chrome-extension | ||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }} | ||
| FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }} | ||
| NODE_ENV: test | ||
| CI: true | ||
| GITHUB_ACTIONS: true | ||
| run: npm run test:e2e:drag-drop | ||
|
|
||
| # - name: Run All E2E Tests | ||
| # working-directory: ./chrome-extension | ||
| # env: | ||
| # GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| # NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }} | ||
| # FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }} | ||
| # NODE_ENV: test | ||
| # CI: true | ||
| # GITHUB_ACTIONS: true | ||
| # run: npm run test:e2e | ||
| # continue-on-error: true # Allow partial failures for debugging | ||
|
|
||
| - name: Upload E2E Test Screenshots | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: e2e-test-screenshots | ||
| path: chrome-extension/tests/e2e/screenshots/ | ||
| retention-days: 1 | ||
|
|
||
| # Lint and Code Quality | ||
| # lint-and-quality: | ||
| # name: Lint and Code Quality | ||
| # runs-on: ubuntu-latest | ||
|
|
||
| # steps: | ||
| # - name: Checkout code | ||
| # uses: actions/checkout@v4 | ||
|
|
||
| # - name: Setup Node.js | ||
| # uses: actions/setup-node@v4 | ||
| # with: | ||
| # node-version: '18' | ||
| # cache: 'npm' | ||
| # cache-dependency-path: chrome-extension/package-lock.json | ||
|
|
||
| # - name: Install Chrome Extension dependencies | ||
| # working-directory: ./chrome-extension | ||
| # run: npm ci | ||
|
|
||
| # - name: Run ESLint | ||
| # working-directory: ./chrome-extension | ||
| # run: npm run lint | ||
|
|
||
| # Build Verification | ||
| build-verification: | ||
| name: Build Verification | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| cache: 'npm' | ||
| cache-dependency-path: | | ||
| chrome-extension/package-lock.json | ||
| backend/package-lock.json | ||
|
|
||
| - name: Install Chrome Extension dependencies | ||
| working-directory: ./chrome-extension | ||
| run: npm ci | ||
|
|
||
| - name: Build Chrome Extension | ||
| working-directory: ./chrome-extension | ||
| run: npm run build | ||
|
|
||
| - name: Verify Extension Files | ||
| run: | | ||
| echo "Verifying Chrome Extension build files..." | ||
| ls -la chrome-extension/dist/ | ||
| test -f chrome-extension/dist/manifest.json | ||
| test -f chrome-extension/dist/background.js | ||
| test -f chrome-extension/dist/content.js | ||
| test -f chrome-extension/dist/main.js | ||
| echo "✅ All required extension files present" | ||
|
|
||
|
|
||
| - name: Upload Build Artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: build-artifacts-${{ matrix.os }} | ||
| path: | | ||
| chrome-extension/dist/ | ||
| retention-days: 1 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
ecmaVersion: 2020on line 35 is redundant becauseparserOptions.ecmaVersion: 'latest'on line 42 is also specified. In ESLint's flat config,parserOptionsare nested underlanguageOptions, and the more specific setting takes precedence. To avoid confusion and keep the configuration clean, you should remove the redundantecmaVersionfrom the top level oflanguageOptions.