[PR #5083] [CLOSED] test(frontend): mock axios globally to prevent flaky network errors on CI #5771

Closed
opened 2026-11-02 04:03:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5083
Author: @rqzbeh
Created: 6/8/2026
Status: ❌ Closed

Base: main ← Head: fix/test-network-errors


📝 Commits (1)

  • d6d5b79 test(frontend): mock axios globally to prevent flaky network errors on CI

📊 Changes

1 file changed (+9 additions, -0 deletions)

View changed files

📝 frontend/src/test/setup.components.ts (+9 -0)

📄 Description

This mocks axios globally in the component test setup to prevent 'AxiosError: Network Error' and 'window is not defined' unhandled exceptions caused by delayed network rejections during test teardown. Tests now complete strictly synchronously before JSDOM destroys the window.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5083 **Author:** [@rqzbeh](https://github.com/rqzbeh) **Created:** 6/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/test-network-errors` --- ### 📝 Commits (1) - [`d6d5b79`](https://github.com/MHSanaei/3x-ui/commit/d6d5b79f761cfe93e84196f5277e4ea645936729) test(frontend): mock axios globally to prevent flaky network errors on CI ### 📊 Changes **1 file changed** (+9 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/test/setup.components.ts` (+9 -0) </details> ### 📄 Description This mocks axios globally in the component test setup to prevent 'AxiosError: Network Error' and 'window is not defined' unhandled exceptions caused by delayed network rejections during test teardown. Tests now complete strictly synchronously before JSDOM destroys the window. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:03:58 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5771
No description provided.