Skip to content

refactor(web): consolidate ApiClient, clean stale config, expand tests - #320

Merged
ajianaz merged 1 commit into
developfrom
refactor/web-hygiene-tests
Sep 3, 2026
Merged

refactor(web): consolidate ApiClient, clean stale config, expand tests#320
ajianaz merged 1 commit into
developfrom
refactor/web-hygiene-tests

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What

  • Migrates the four standalone alert-rule functions and fetchAttachments into ApiClient methods (removes the duplicated raw-fetch/401 boilerplate and resolves the long-standing TODO in api.ts); rules and event-detail call sites now use the shared client
  • Removes the stale tailwind.config.js reference from components.json (Tailwind v4 is CSS-config only)
  • New component tests for Pagination and EmptyState using the previously-unused @testing-library/svelte; vitest config gains the svelte plugin + browser resolve condition to support Svelte 5 client rendering under jsdom
  • Unit tests for rowKeyActivate and crashRateBarClass
  • New mobile e2e spec: drawer navigation between pages and a no-horizontal-overflow assertion at 390px

Why

The API layer was split between the class and copy-pasted standalone fetch functions (error/401 handling drift risk). Test coverage had zero component tests and no mobile-viewport e2e, despite the dashboard now having a mobile-specific drawer.

Testing

  • Unit/component: 21/21 pass (was 10)
  • e2e: 18/18 pass, including the 2 new mobile tests
  • npm run check (0 errors) and npm run build pass

- Migrate the four standalone alert-rule functions and fetchAttachments
  into ApiClient methods, removing the duplicated 401/boilerplate fetch
  code and the migrate TODO; call sites in rules and event detail pages
  updated to the shared client
- Drop the stale tailwind.config.js reference from components.json
  (Tailwind v4 is CSS-config only)
- Component tests for Pagination and EmptyState via
  @testing-library/svelte; vitest gains the svelte plugin + browser
  resolve condition; unit tests for rowKeyActivate and
  crashRateBarClass
- New mobile e2e spec: drawer navigation and no-horizontal-overflow
  check at 390px
@ajianaz
ajianaz merged commit d5f0f82 into develop Sep 3, 2026
17 checks passed
@ajianaz
ajianaz deleted the refactor/web-hygiene-tests branch September 3, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant