fix tests
This commit is contained in:
@@ -234,6 +234,9 @@ export function cleanText(text: string): string {
|
||||
|
||||
// Remove spaces around newlines
|
||||
cleaned = cleaned.replace(/ *\n */g, '\n');
|
||||
|
||||
// Normalize multiple spaces to single space within lines
|
||||
cleaned = cleaned.replace(/ {2,}/g, ' ');
|
||||
|
||||
// Remove hashtags from end of text
|
||||
// Pattern: #word #multiple_words (supports international characters)
|
||||
|
||||
@@ -81,7 +81,11 @@ describe('extractFromDOM() with mocked og:description', () => {
|
||||
$$: vi.fn().mockResolvedValue([]),
|
||||
locator: vi.fn().mockReturnValue({
|
||||
getAttribute: vi.fn().mockResolvedValue(null)
|
||||
})
|
||||
}),
|
||||
waitForLoadState: vi.fn().mockResolvedValue(undefined),
|
||||
waitForSelector: vi.fn().mockRejectedValue(new Error('No selector found')),
|
||||
waitForTimeout: vi.fn().mockResolvedValue(undefined),
|
||||
on: vi.fn()
|
||||
} as unknown as Page;
|
||||
};
|
||||
|
||||
@@ -153,7 +157,11 @@ describe('Integration: Full extraction flow', () => {
|
||||
$$: vi.fn().mockResolvedValue([]),
|
||||
locator: vi.fn().mockReturnValue({
|
||||
getAttribute: vi.fn().mockResolvedValue(null)
|
||||
})
|
||||
}),
|
||||
waitForLoadState: vi.fn().mockResolvedValue(undefined),
|
||||
waitForSelector: vi.fn().mockRejectedValue(new Error('No selector found')),
|
||||
waitForTimeout: vi.fn().mockResolvedValue(undefined),
|
||||
on: vi.fn()
|
||||
} as unknown as Page;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user