Add backend unit/integration tests, Playwright e2e tests, README, cookie Secure fix
SonarQube Analysis / sonarqube (push) Successful in 4m20s

This commit is contained in:
2026-08-13 22:35:38 +00:00
parent 2adbf24b23
commit 921022c658
25 changed files with 6600 additions and 57 deletions
+19
View File
@@ -0,0 +1,19 @@
export function toCents(price: string | number): number {
const n = typeof price === 'string' ? parseFloat(price) : price;
if (Number.isNaN(n) || n < 0) {
throw new Error('invalid price');
}
return Math.round(n * 100);
}
export function formatPrice(cents: number): string {
return `$${(cents / 100).toFixed(2)}`;
}
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
export function isValidEmail(email: string): boolean {
return EMAIL_RE.test(email.trim());
}
export const MARKETING_CONSENT_TEXT =
'I want to receive occasional emails about new one-of-a-kind items from Redefined Designs. I can unsubscribe at any time.';