many fixes resulting from latest refactoring
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 8m6s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 8m6s
This commit is contained in:
@@ -91,7 +91,8 @@ describe('AI API Client (Network Mocking with MSW)', () => {
|
||||
|
||||
expect(req.endpoint).toBe('upload-and-process');
|
||||
expect(req.method).toBe('POST');
|
||||
expect(req.body).toBeInstanceOf(FormData);
|
||||
// FIX: Use a duck-typing check for FormData to avoid environment-specific instance issues.
|
||||
expect(typeof (req.body as FormData).get).toBe('function');
|
||||
|
||||
const flyerFile = (req.body as FormData).get('flyerFile') as File;
|
||||
const checksumValue = (req.body as FormData).get('checksum');
|
||||
@@ -125,7 +126,7 @@ describe('AI API Client (Network Mocking with MSW)', () => {
|
||||
|
||||
expect(req.endpoint).toBe('check-flyer');
|
||||
expect(req.method).toBe('POST');
|
||||
expect(req.body).toBeInstanceOf(FormData);
|
||||
expect(typeof (req.body as FormData).get).toBe('function');
|
||||
const imageFile = (req.body as FormData).get('image') as File;
|
||||
expect(imageFile.name).toBe('flyer.jpg');
|
||||
});
|
||||
@@ -140,7 +141,7 @@ describe('AI API Client (Network Mocking with MSW)', () => {
|
||||
const req = requestSpy.mock.calls[0][0];
|
||||
|
||||
expect(req.endpoint).toBe('extract-address');
|
||||
expect(req.body).toBeInstanceOf(FormData);
|
||||
expect(typeof (req.body as FormData).get).toBe('function');
|
||||
const imageFile = (req.body as FormData).get('image') as File;
|
||||
expect(imageFile.name).toBe('flyer.jpg');
|
||||
});
|
||||
@@ -155,7 +156,7 @@ describe('AI API Client (Network Mocking with MSW)', () => {
|
||||
const req = requestSpy.mock.calls[0][0];
|
||||
|
||||
expect(req.endpoint).toBe('extract-logo');
|
||||
expect(req.body).toBeInstanceOf(FormData);
|
||||
expect(typeof (req.body as FormData).get).toBe('function');
|
||||
const imageFile = (req.body as FormData).get('images') as File;
|
||||
expect(imageFile.name).toBe('logo.jpg');
|
||||
});
|
||||
@@ -254,7 +255,7 @@ describe('AI API Client (Network Mocking with MSW)', () => {
|
||||
const req = requestSpy.mock.calls[0][0];
|
||||
|
||||
expect(req.endpoint).toBe('rescan-area');
|
||||
expect(req.body).toBeInstanceOf(FormData);
|
||||
expect(typeof (req.body as FormData).get).toBe('function');
|
||||
|
||||
const imageFile = (req.body as FormData).get('image') as File;
|
||||
const cropAreaValue = (req.body as FormData).get('cropArea');
|
||||
|
||||
Reference in New Issue
Block a user