### **PR Type** Tests, Enhancement ___ ### **Description** - Add comprehensive settings unit tests - Introduce regex patterns test suite - Expand MSW handlers for settings APIs - Add mock data for regex patterns ___ ### Diagram Walkthrough ```mermaid flowchart LR Specs["New settings/regex spec files"] -- "use" --> MSW["MSW rest handlers"] MSW -- "serve" --> Mocks["Regex patterns mock data"] Specs -- "mount" --> Components["Settings components"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><details><summary>6 files</summary><table> <tr> <td><strong>AddRegexPattern.spec.ts</strong><dd><code>Add end-to-end unit tests for AddRegexPattern</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8132/files#diff-8010ecaba14a295a81248da3901421fe133feb14b178512a4690d2c76eabde03">+626/-0</a> </td> </tr> <tr> <td><strong>CipherKeys.spec.ts</strong><dd><code>Add full unit tests for Cipher Keys page</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8132/files#diff-017c69ca1a10dd456e41c8fd188539c6b8c57c0437351710a177358ae3db1fef">+787/-0</a> </td> </tr> <tr> <td><strong>General.spec.ts</strong><dd><code>Add unit tests for General settings and branding</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8132/files#diff-f3b556321cf5c1b7cfcc36507d050f70ea355971d718ddb6bafa6faf2dc6d298">+851/-0</a> </td> </tr> <tr> <td><strong>NoRegexPatterns.spec.ts</strong><dd><code>Add unit tests for empty Regex Patterns state</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8132/files#diff-92a31474de14534958fdf8056a7e6ab9334493c92740fe1ed738fabf01de18cd">+361/-0</a> </td> </tr> <tr> <td><strong>index.spec.ts</strong><dd><code>Add unit tests for Settings index navigation and tabs</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8132/files#diff-7c2e13b69b48077a1e82e767fa048995d42d4bef03362f19ad0897f7e2a4dfb3">+543/-0</a> </td> </tr> <tr> <td><strong>regexPatterns.ts</strong><dd><code>Add mock data for regex patterns and results</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8132/files#diff-c7324fdbffcb15b12d0597c7235234970331a4e4819611e1241a00b1b936f570">+41/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Enhancement</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>handlers.ts</strong><dd><code>Extend MSW handlers for settings and regex APIs</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8132/files#diff-fa72375a2848d474b311c07cf6aef7d6117b1f4d88f56a74c9207f39df72333c">+96/-0</a> </td> </tr> </table></details></td></tr></tr></tbody></table> </details> ___
web
This template should help get you started developing with Vue 3 in Vite.
Recommended IDE Setup
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
Type Support for .vue Imports in TS
TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensionsfrom VSCode's command palette - Find
TypeScript and JavaScript Language Features, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Windowfrom the command palette.
Customize configuration
See Vite Configuration Reference.
Project Setup
npm install
Compile and Hot-Reload for Development
For stand-alone UI development environment, create .env file and which contains below environment variable
VITE_OPENOBSERVE_ENDPOINT=http://localhost:5080/
npm run dev
Type-Check, Compile and Minify for Production
npm run build
Run Unit Tests with Vitest
npm run test:unit
Run End-to-End Tests with Cypress
npm run test:e2e:dev
This runs the end-to-end tests against the Vite development server. It is much faster than the production build.
But it's still recommended to test the production build with test:e2e before deploying (e.g. in CI environments):
npm run build
npm run test:e2e
Lint with ESLint
npm run lint