### **PR Type**
Tests
___
### **Description**
- Add comprehensive IAM groups unit tests
- Cover create, list, edit flows
- Include roles, users, service accounts
- Verify notifications and error handling
___
### Diagram Walkthrough
```mermaid
flowchart LR
AddGroupSpec["AddGroup.spec: create group tests"]
AppGroupsSpec["AppGroups.spec: list/delete groups tests"]
EditGroupSpec["EditGroup.spec: edit group tests"]
GroupRolesSpec["GroupRoles.spec: manage roles tests"]
GroupUsersSpec["GroupUsers.spec: manage users tests"]
GroupSActionsSpec["GroupServiceAccounts.spec: manage service accounts tests"]
AddGroupSpec -- "emit, validate, notify" --> AppGroupsSpec
AppGroupsSpec -- "edit/delete navigation" --> EditGroupSpec
EditGroupSpec -- "tabs and updates" --> GroupRolesSpec
EditGroupSpec -- "tabs and updates" --> GroupUsersSpec
EditGroupSpec -- "tabs and updates" --> GroupSActionsSpec
```
<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><table>
<tr>
<td>
<details>
<summary><strong>AddGroup.spec.ts</strong><dd><code>Tests for AddGroup
dialog behaviors</code>
</dd></summary>
<hr>
web/src/components/iam/groups/AddGroup.spec.ts
<ul><li>Add unit tests for AddGroup dialog<br> <li> Validate input rules
and trimming<br> <li> Mock IAM createGroup and notifications<br> <li>
Test success and error scenarios</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8105/files#diff-2bf9c9935bbd22db8608e9b5e12c1f85ad8afcb9a4eacb5cee672e69e544a79e">+340/-0</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>AppGroups.spec.ts</strong><dd><code>Tests for Groups
list and actions</code>
</dd></summary>
<hr>
web/src/components/iam/groups/AppGroups.spec.ts
<ul><li>Add tests for groups listing table<br> <li> Cover search, add
dialog, actions<br> <li> Mock permissions, router, and services<br> <li>
Test delete flow with notifications</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8105/files#diff-cfe60bc2c1440c6b2a41eb2db9901f922afa6adcd09ae263d4444556a1d1ac12">+486/-0</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>EditGroup.spec.ts</strong><dd><code>Tests for EditGroup
flows and tabs</code>
</dd></summary>
<hr>
web/src/components/iam/groups/EditGroup.spec.ts
<ul><li>Add tests for editing group details<br> <li> Cover tabs, data
fetch, save payload<br> <li> Validate notifications and navigation<br>
<li> Mock child components and services</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8105/files#diff-7683afda02004afab5d91e031b8ae82d614ecae38c926f6b6af2d3cf9528b725">+561/-0</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>GroupRoles.spec.ts</strong><dd><code>Tests for group
roles selection</code>
</dd></summary>
<hr>
web/src/components/iam/groups/GroupRoles.spec.ts
<ul><li>Add tests for role selection table<br> <li> Cover filtering,
search, and selection sets<br> <li> Mock getRoles and permissions
state<br> <li> Verify rows/columns and edge cases</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8105/files#diff-0833bc337b21487c4ef1deffcac799a91dbaf35241374284deb328e6482c11d9">+533/-0</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>GroupServiceAccounts.spec.ts</strong><dd><code>Tests
for service accounts management</code>
</dd></summary>
<hr>
web/src/components/iam/groups/GroupServiceAccounts.spec.ts
<ul><li>Add tests for service accounts selection<br> <li> Cover data
fetch, filter, search<br> <li> Validate add/remove selection logic<br>
<li> Note existing bug in removedUsers logic</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8105/files#diff-ef96f03e5a8237d18edf3b51dcf65f33d6f2938859a9a55d10eaf0f502954589">+572/-0</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>GroupUsers.spec.ts</strong><dd><code>Tests for group
users management and org filters</code>
</dd></summary>
<hr>
web/src/components/iam/groups/GroupUsers.spec.ts
<ul><li>Add extensive tests for users selection<br> <li> Cover org
filtering, meta org, search<br> <li> Validate selection add/remove
sets<br> <li> Theme and accessibility checks included</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8105/files#diff-7a9c6922e6c8a7d2c052f7f74ceba652af41bc123aa127a05276696278d792d8">+894/-0</a>
</td>
</tr>
</table></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