mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 09:19:43 +00:00
[test] fix flaky Vue upload widget browser tests using randomize url param (#5845)
## Summary Fix browser tests that use filenames in loader nodes. When the files don't exist, the fallback/error component shows the request URL which contains random cache-busting param which makes tests fail due to non-deterministic nature. [Context](https://github.com/Comfy-Org/ComfyUI_frontend/pull/5831#discussion_r2386582256) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5845-test-fix-flaky-Vue-upload-widget-browser-tests-using-randomize-url-param-27d6d73d36508107a0d0d52d2764a028) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -20,7 +20,9 @@
|
||||
>
|
||||
<i-lucide:image-off class="w-12 h-12 mb-2 text-gray-400" />
|
||||
<p class="text-sm text-gray-300">{{ $t('g.imageFailedToLoad') }}</p>
|
||||
<p class="text-xs text-gray-400 mt-1">{{ currentImageUrl }}</p>
|
||||
<p class="text-xs text-gray-400 mt-1">
|
||||
{{ getImageFilename(currentImageUrl) }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Loading State -->
|
||||
@@ -260,4 +262,12 @@ const handleKeyDown = (event: KeyboardEvent) => {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const getImageFilename = (url: string): string => {
|
||||
try {
|
||||
return new URL(url).searchParams.get('filename') || 'Unknown file'
|
||||
} catch {
|
||||
return 'Invalid URL'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user