From 94c0177f1b8a9e843234c8a2450b739f4af8856a Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 3 Dec 2024 14:37:45 +0100 Subject: [PATCH] feat: mock validations --- test/vitest/helper.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/vitest/helper.js b/test/vitest/helper.js index 4bfae5dc8..ce057c7c3 100644 --- a/test/vitest/helper.js +++ b/test/vitest/helper.js @@ -44,7 +44,18 @@ vi.mock('vue-router', () => ({ vi.mock('axios'); vi.spyOn(useValidator, 'useValidator').mockImplementation(() => { - return { validate: vi.fn() }; + return { + validate: vi.fn(), + validations: () => ({ + format: vi.fn(), + presence: vi.fn(), + required: vi.fn(), + length: vi.fn(), + numericality: vi.fn(), + min: vi.fn(), + custom: vi.fn(), + }), + }; }); class FormDataMock {