fix: add missing vi import and fix getByText exact match assertions
- analytics.test.ts: add vi to vitest import (was used at lines 24, 37, 66) - BookingError.test.tsx: use regex matchers so phone/email assertions match partial text in combined <p> element Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -28,11 +28,11 @@ describe("BookingErrorPage", () => {
|
||||
|
||||
it("displays business contact phone", () => {
|
||||
render(<BookingErrorPage />);
|
||||
expect(screen.getByText(BUSINESS_CONTACT_INFO.phone)).toBeInTheDocument();
|
||||
expect(screen.getByText(new RegExp(BUSINESS_CONTACT_INFO.phone.replace(/[()]/g, "\\$&")))).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("displays business contact email", () => {
|
||||
render(<BookingErrorPage />);
|
||||
expect(screen.getByText(BUSINESS_CONTACT_INFO.email)).toBeInTheDocument();
|
||||
expect(screen.getByText(new RegExp(BUSINESS_CONTACT_INFO.email))).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { describe, it, expect, vi } from "vitest";
|
||||
import { ANALYTICS_EVENTS, fireAnalyticsEvent } from "../lib/analytics";
|
||||
|
||||
describe("analytics", () => {
|
||||
|
||||
Reference in New Issue
Block a user