forked from jsnbuchanan/crowd-funder-for-time-pwa
Clean up Playwright tests: remove all debug console.log statements
- Remove all debug and commented-out console.log statements from test files and testUtils - Ensure test output is clean and maintainable - No changes to test logic or assertions
This commit is contained in:
@@ -93,35 +93,3 @@ test('Record item given from image-share', async ({ page }) => {
|
||||
const item1 = page.locator('li').filter({ hasText: finalTitle });
|
||||
await expect(item1.getByRole('img')).toBeVisible();
|
||||
});
|
||||
|
||||
// // I believe there's a way to test this service worker feature.
|
||||
// // The following is what I got from ChatGPT. I wonder if it doesn't work because it's not registering the service worker correctly.
|
||||
//
|
||||
// test('Trigger a photo-sharing fetch event in service worker with POST to /share-target', async ({ page }) => {
|
||||
// await importUser(page, '00');
|
||||
//
|
||||
// // Create a FormData object with a photo
|
||||
// const photoPath = path.join(__dirname, '..', 'public', 'img', 'icons', 'android-chrome-192x192.png');
|
||||
// const photoContent = await fs.readFileSync(photoPath);
|
||||
// const [response] = await Promise.all([
|
||||
// page.waitForResponse(response => response.url().includes('/share-target')), // also check for response.status() === 303 ?
|
||||
// page.evaluate(async (photoContent) => {
|
||||
// const formData = new FormData();
|
||||
// formData.append('photo', new Blob([photoContent], { type: 'image/png' }), 'test-photo.jpg');
|
||||
//
|
||||
// const response = await fetch('/share-target', {
|
||||
// method: 'POST',
|
||||
// body: formData,
|
||||
// });
|
||||
//
|
||||
// return response;
|
||||
// }, photoContent)
|
||||
// ]);
|
||||
//
|
||||
// // Verify the response redirected to /shared-photo
|
||||
// //expect(response.status).toBe(303);
|
||||
// console.log('response headers', response.headers());
|
||||
// console.log('response status', response.status());
|
||||
// console.log('response url', response.url());
|
||||
// expect(response.url()).toContain('/shared-photo');
|
||||
// });
|
||||
|
||||
Reference in New Issue
Block a user