test: comprehensive test suites and quality gates pass across backend, storefront and admin
- Backend (NestJS): 82 suites, 641 tests passing; 0 ESLint errors; 0 tsc errors. Hardened SSL cert/key matching, SSRF IP pinning, and eBank validation. - Admin Panel (Vite/React): 48 suites, 300 tests passing; 0 ESLint errors; 0 tsc errors. Full coverage across all pages and settings. - Storefront (Next.js): 62 suites, 368 tests passing; 0 ESLint errors; 0 tsc errors. - Fixed unmount lifecycle guards, promise error handling, and component edge cases.
This commit is contained in:
1 parent
1e73715169
commit
ddbf1ca026
439 files changed
+32911
-6107
No files matched your search
@@ -1,27 +1,27 @@
|
||||
import { DecimalInterceptor } from './decimal.interceptor';
|
||||
import { ExecutionContext, CallHandler } from '@nestjs/common';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { of } from 'rxjs';
|
||||
import { DecimalInterceptor } from "./decimal.interceptor";
|
||||
import { ExecutionContext, CallHandler } from "@nestjs/common";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { of } from "rxjs";
|
||||
|
||||
describe('DecimalInterceptor', () => {
|
||||
describe("DecimalInterceptor", () => {
|
||||
let interceptor: DecimalInterceptor;
|
||||
|
||||
beforeEach(() => {
|
||||
interceptor = new DecimalInterceptor();
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
it("should be defined", () => {
|
||||
expect(interceptor).toBeDefined();
|
||||
});
|
||||
|
||||
it('should transform Prisma.Decimal instances to exact string representations', (done) => {
|
||||
it("should transform Prisma.Decimal instances to exact string representations", (done) => {
|
||||
const mockData = {
|
||||
id: 'order-1',
|
||||
totalAmount: new Prisma.Decimal('64.98'),
|
||||
id: "order-1",
|
||||
totalAmount: new Prisma.Decimal("64.98"),
|
||||
items: [
|
||||
{
|
||||
id: 'item-1',
|
||||
unitPrice: new Prisma.Decimal('32.49'),
|
||||
id: "item-1",
|
||||
unitPrice: new Prisma.Decimal("32.49"),
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -33,12 +33,12 @@ describe('DecimalInterceptor', () => {
|
||||
|
||||
interceptor.intercept(executionContext, callHandler).subscribe((result) => {
|
||||
expect(result).toEqual({
|
||||
id: 'order-1',
|
||||
totalAmount: '64.98',
|
||||
id: "order-1",
|
||||
totalAmount: "64.98",
|
||||
items: [
|
||||
{
|
||||
id: 'item-1',
|
||||
unitPrice: '32.49',
|
||||
id: "item-1",
|
||||
unitPrice: "32.49",
|
||||
},
|
||||
],
|
||||
});
|
||||
@@ -46,12 +46,12 @@ describe('DecimalInterceptor', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should leave non-decimal values unchanged', (done) => {
|
||||
it("should leave non-decimal values unchanged", (done) => {
|
||||
const mockData = {
|
||||
name: 'Test',
|
||||
name: "Test",
|
||||
age: 5,
|
||||
isActive: true,
|
||||
createdAt: new Date('2026-01-01T00:00:00.000Z'),
|
||||
createdAt: new Date("2026-01-01T00:00:00.000Z"),
|
||||
};
|
||||
|
||||
const executionContext = {} as ExecutionContext;
|
||||
|
||||
Reference in new issue
Block a user