ui_migration feature(vitest) Reduce boilerplate code at overrides

This commit is contained in:
Antonio Anaya 2026-06-17 01:53:51 -06:00 committed by Antonio Anaya
parent ffcc7f936b
commit c33782e9d6
2 changed files with 11 additions and 63 deletions

View file

@ -110,7 +110,9 @@ describe("Unit Test", () => {
* Look up the specific config for this file, default to an empty object
* Override specific props
* Inject the specific state if it exists, otherwise use empty object
* Mocks values come from MIXINS
* * Note on Global Mocks:
* The mock functions below stub out standard Mixin methods that typically interact with the Pinia store.
* These should not be moved to `overrides.js` Defining them here significantly reduces boilerplate configuration inside `overrides.js`.
*/
const testRunner = isSkipped ? it.skip : it;
@ -138,6 +140,14 @@ describe("Unit Test", () => {
actions: {},
properties: {},
})),
thingDescriptions: vi.fn(() => ({
test_thing: {
properties: {
test_property_1: {},
test_property_2: {},
},
},
})),
getOngoingAction: vi.fn(() => Promise.resolve()),
getThingEndpoint: vi.fn(() => Promise.resolve([])),
modalError: "",