mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 07:00:23 +00:00
[auto-fix] Apply ESLint and Prettier fixes
This commit is contained in:
@@ -74,12 +74,14 @@ export class LocationMock {
|
||||
/**
|
||||
* Update the mock location during test execution
|
||||
*/
|
||||
async updateLocation(updates: Partial<{
|
||||
href: string
|
||||
pathname: string
|
||||
search: string
|
||||
hash: string
|
||||
}>) {
|
||||
async updateLocation(
|
||||
updates: Partial<{
|
||||
href: string
|
||||
pathname: string
|
||||
search: string
|
||||
hash: string
|
||||
}>
|
||||
) {
|
||||
await this.page.evaluate((updates) => {
|
||||
const location = window.location as any
|
||||
Object.keys(updates).forEach((key) => {
|
||||
@@ -139,4 +141,4 @@ export class LocationMock {
|
||||
location.reload()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { expect } from '@playwright/test'
|
||||
|
||||
import { comfyPageFixture as test } from './fixtures/ComfyPage'
|
||||
import { LocationMock } from './helpers/locationMock'
|
||||
|
||||
@@ -66,9 +67,15 @@ test.describe('Location Mock Example', () => {
|
||||
await locationMock.reload()
|
||||
|
||||
// Verify mock methods were called
|
||||
expect(consoleMessages.some((msg) => msg.includes('location.assign'))).toBeTruthy()
|
||||
expect(consoleMessages.some((msg) => msg.includes('location.replace'))).toBeTruthy()
|
||||
expect(consoleMessages.some((msg) => msg.includes('location.reload'))).toBeTruthy()
|
||||
expect(
|
||||
consoleMessages.some((msg) => msg.includes('location.assign'))
|
||||
).toBeTruthy()
|
||||
expect(
|
||||
consoleMessages.some((msg) => msg.includes('location.replace'))
|
||||
).toBeTruthy()
|
||||
expect(
|
||||
consoleMessages.some((msg) => msg.includes('location.reload'))
|
||||
).toBeTruthy()
|
||||
})
|
||||
|
||||
test('should work with Happy DOM globals', async ({ page, comfyPage }) => {
|
||||
@@ -93,4 +100,4 @@ test.describe('Location Mock Example', () => {
|
||||
expect(location.canReplace).toBeTruthy()
|
||||
expect(location.canReload).toBeTruthy()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user