koudaiii / learn-microsoft-com-update-checker

Chrome extension to check and display the latest update date from the English version of Microsoft Learn pages when viewing the current language version.
https://chromewebstore.google.com/detail/learnmicrosoftcom-update/addjjinolilbffnlnfbaglljhngjminl
MIT License
1 stars 1 forks source link

refactoring test case #22

Closed koudaiii closed 1 month ago

koudaiii commented 1 month ago

This pull request refactors the E2E tests for the JP Learn Microsoft.com Update Checker to make them more maintainable and comprehensive. The changes primarily involve consolidating multiple individual test cases into a single parameterized test suite, improving the readability and reusability of the tests.

Refactoring of E2E Tests:

These changes improve the maintainability of the tests by reducing code duplication and making it easier to add new test cases for different scenarios.

koudaiii commented 1 month ago
$ npm run test:e2e

> jp-learn-microsoft-com-update-checker@1.2.0 test:e2e
> jest tests/e2e

 PASS  tests/e2e/content.e2e.test.js (14.352 s)
  JP Learn Microsoft.com Update Checker E2E Test
    ✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with dark theme in dark mode (1726 ms)
    ✓ should not run script on en-us pages  with dark theme in dark mode (418 ms)
    ✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with dark theme in light mode (1231 ms)
    ✓ should not run script on en-us pages  with dark theme in light mode (172 ms)
    ✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with light theme in dark mode (1220 ms)
    ✓ should not run script on en-us pages  with light theme in dark mode (158 ms)
    ✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with light theme in light mode (1211 ms)
    ✓ should not run script on en-us pages  with light theme in light mode (153 ms)
    ✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with high-contrast theme in dark mode (1224 ms)
    ✓ should not run script on en-us pages  with high-contrast theme in dark mode (158 ms)
    ✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with high-contrast theme in light mode (1216 ms)
    ✓ should not run script on en-us pages  with high-contrast theme in light mode (155 ms)
    ✓ should display English update date on https://learn.microsoft.com/zh-cn/azure/virtual-machines/overview with light theme in light mode (1496 ms)
    ✓ should not run script on en-us pages  with light theme in light mode (153 ms)
    ✓ should run script with jp-learn-microsoft-com-update-checker-debug flag (193 ms)

Test Suites: 1 passed, 1 total
Tests:       15 passed, 15 total
Snapshots:   0 total
Time:        14.411 s, estimated 21 s
Ran all test suites matching /tests\/e2e/i.

👌