feat(contact): add toast notifications for form feedback

- Add toast notifications for contact form success/error responses
- Add toast notifications for backend errors in AppFooter
- Add accessibility explanation for honeypot field
- Add loading state to contact form submit button
- Add i18n translations for toast messages (en/fr)
- Fix honeypot input missing v-model binding
This commit is contained in:
2026-02-04 15:19:08 +01:00
parent 10e51b5da4
commit 37972aa660
6 changed files with 57 additions and 17 deletions

View File

@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { nextTick } from 'vue';
import type { FetchError } from 'ofetch';
@@ -14,10 +16,6 @@ vi.mock('#app', () => ({
}));
// Mock $fetch globally
declare global {
var $fetch: ReturnType<typeof vi.fn>;
}
// global.$fetch = vi.fn();
vi.mock('#app', () => ({
useRuntimeConfig: vi.fn(() => ({
public: {

View File

@@ -7,7 +7,7 @@ export const useBackend = () => {
const getMeta = (): UseApiResponse<MetaResponse> => api.get<MetaResponse>('/meta');
const postContact = (): UseApiResponse<ContactResponse, ContactRequest> =>
api.post<ContactResponse, ContactRequest>('/contact', undefined, true);
api.post<ContactResponse, ContactRequest>('/contact', undefined, false);
return { getMeta, postContact };
};