fleet/frontend/test
jacobshandling 8b09e9d239
UI: Linux setup experience - IT admin updates (#32569)
## PR 1/2 for #32037 

- Implements update for the Linux setup experience from the IT admin's
point of view. Updates for the end-user ("My device" page) to follow
- Works in concert with the new endpoints implemented in
https://github.com/fleetdm/fleet/pull/32493

- Splits Controls > Setup experience > Install software into 3 tabbed
sections, one for each of macOS, Windows (placeholder state for now, to
be implemented in following iteration), and Linux.
- Dynamically calls new GET and PUT endpoints and routes data
accordingly depending on which platform software for install is being
updated for.
- Update the software selection modal to display software package
versions, including the package type (deb, rpm, or tar) for Linux
software packges.
- New activity feed item
- Update relevant tests


![ezgif-86da6f2b97d770](https://github.com/user-attachments/assets/6ae95bb7-f629-472e-b996-fcba1cf83e76)
_Note that the lower-right-hand image in this GIF is outdated and will
be updated with new content once this entire feature is integrated_


~- [ ] Changes file added for user-visible changes in `changes/`~ will
include in PR 2/2
- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

- [x] Verified that any relevant UI is disabled when GitOps mode is
enabled

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2025-09-04 10:24:05 -07:00
..
handlers UI: Linux setup experience - IT admin updates (#32569) 2025-09-04 10:24:05 -07:00
default-handlers.ts disabled manual agent install checkbox when setup experience software and run script is already added (#28679) 2025-04-30 16:22:24 +01:00
jest.config.ts Microsoft Compliance Partner backend changes (#29540) 2025-06-11 14:22:46 -03:00
mock-server.ts Frontend Integration Tests: Create activity integration tests, reorganized mock server calls (#8620) 2022-11-15 13:29:12 +00:00
README.md Organize contributor docs and establish ADR process and template (#29101) 2025-05-17 15:03:52 -05:00
stubs.ts Frontend refactor: To typescript, remove unused testing stubs, functi… (#20306) 2024-07-24 12:08:38 -04:00
test-setup.ts Suppress unneeded react tooltip test warning and update lib to latest version (#30584) 2025-07-07 15:33:35 +01:00
test-utils.tsx UI: Move SSO and Host status webhook settings (#30582) 2025-07-07 07:37:13 -07:00

Fleet UI tests

The test directory contains the jest configuration, test setup, request handlers, mock server definition, testing utilities, and entity stubs (deprecated and will be replaced by mocks in frontend/__mocks__) for use in test files throughout the application. The test files for components and app functions are located in the same directory as the files they test.

Table of contents

Jest configuration

This is where the jest configuration is located. Refer to Jest's official documentation.

Test setup

This file configures the testing environment for every test file.

Request handlers and their setup

Default handlers and custom handlers are both defined within the handlers directory and return mocked data. The handlers directory will naturally grow with more default and custom handlers required for more tests. We use mock service worker to define all request handlers.

Default handlers and custom handlers differ in their setup. Default handlers are setup in mock-server.ts. The mock server will serve the default handlers outlined in default-handlers.ts. Custom handlers must be setup inline within a component's test suite (frontend/**/ComponentName.tests.tsx). For example, we would setup the custom handler activityHandler9Activities inline using mockServer.use(activityHandler9Activities);.

Testing utilities

We use various utility functions to write our tests.

Testing stubs Deprecated

Testing stubs are still being used in a handful of old tests. We are no longer following this pattern of adding data to testing stubs. Rather, we are building stubs as mocks located in the frontend/__mocks__ directory.

Check out how we mock data used for unit and integration tests.

Follow this guide to run tests locally.

Visit the frontend overview of Fleet UI testing for more information on our testing strategy, philosophies, and tools.