fix tests
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -34,3 +34,4 @@ debug_page.txt
|
||||
.github/skills
|
||||
|
||||
prompts/
|
||||
test-results/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"value": "SDRORLyWEsWWty2ZoVGdER",
|
||||
"domain": ".instagram.com",
|
||||
"path": "/",
|
||||
"expires": 1805932397.796429,
|
||||
"expires": 1805933297.800746,
|
||||
"httpOnly": false,
|
||||
"secure": true,
|
||||
"sameSite": "Lax"
|
||||
@@ -45,7 +45,7 @@
|
||||
"value": "59661903731",
|
||||
"domain": ".instagram.com",
|
||||
"path": "/",
|
||||
"expires": 1779148397.796565,
|
||||
"expires": 1779149297.800838,
|
||||
"httpOnly": false,
|
||||
"secure": true,
|
||||
"sameSite": "None"
|
||||
@@ -65,14 +65,14 @@
|
||||
"value": "1280x720",
|
||||
"domain": ".instagram.com",
|
||||
"path": "/",
|
||||
"expires": 1771977199,
|
||||
"expires": 1771978099,
|
||||
"httpOnly": false,
|
||||
"secure": true,
|
||||
"sameSite": "Lax"
|
||||
},
|
||||
{
|
||||
"name": "rur",
|
||||
"value": "\"CLN\\05459661903731\\0541802908397:01fef18ba63c9905a3e7585bc775d62a091f163ea66b37227a39ca3c8b1482c88ade3055\"",
|
||||
"value": "\"CLN\\05459661903731\\0541802909297:01fe3b61178e8a40cb655e8d1aa137841487d29a8caf122f877ce2955e92fb4307b53ced\"",
|
||||
"domain": ".instagram.com",
|
||||
"path": "/",
|
||||
"expires": -1,
|
||||
@@ -87,7 +87,7 @@
|
||||
"localStorage": [
|
||||
{
|
||||
"name": "chatd-deviceid",
|
||||
"value": "b042903b-985a-4d93-bbae-f43140b10376"
|
||||
"value": "9b4abdd3-f38f-473e-9e3b-2ae722acc64d"
|
||||
},
|
||||
{
|
||||
"name": "hb_timestamp",
|
||||
@@ -95,7 +95,11 @@
|
||||
},
|
||||
{
|
||||
"name": "IGSession",
|
||||
"value": "k75336:1771374199643"
|
||||
"value": "k75336:1771375099770"
|
||||
},
|
||||
{
|
||||
"name": "mutex_polaris_banzai",
|
||||
"value": "4eic7h:1771373300769"
|
||||
},
|
||||
{
|
||||
"name": "pixel_fire_ts",
|
||||
@@ -107,7 +111,7 @@
|
||||
},
|
||||
{
|
||||
"name": "Session",
|
||||
"value": "5ssy2h:1771372434643"
|
||||
"value": "t5cu8b:1771373334770"
|
||||
},
|
||||
{
|
||||
"name": "has_interop_upgraded",
|
||||
@@ -117,6 +121,10 @@
|
||||
"name": "ig_boost_on_web_campaign_upsell_shown",
|
||||
"value": "false"
|
||||
},
|
||||
{
|
||||
"name": "mutex_banzai",
|
||||
"value": "4eic7h:1771373300769"
|
||||
},
|
||||
{
|
||||
"name": "banzai:last_storage_flush",
|
||||
"value": "1771366998859.2"
|
||||
|
||||
@@ -235,6 +235,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)
|
||||
cleaned = cleaned.replace(/(#[\w\u00C0-\u024F\u1E00-\u1EFF\u0400-\u04FF]+\s*)+$/gi, '').trim();
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export default defineConfig({
|
||||
name: 'server',
|
||||
environment: 'node',
|
||||
include: ['src/**/*.{test,spec}.{js,ts}'],
|
||||
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}']
|
||||
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}', 'src/**/*.e2e.spec.{js,ts}']
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user