mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
fix(test): resolve unit test failures in batch fetch and profile modal
- Mock `readRelays` in `tests/app-batch-fetch-profiles.test.mjs` to correctly reflect `profileMetadataService` prioritization logic, ensuring relay query count assertions match actual execution (2 queries instead of 4). - Add missing `load` mock to `hashtagPreferences` in `tests/profile-modal-controller.test.mjs` to prevent `TypeError` during `handleAddHashtagPreference` test. - Verified all unit tests pass with `npm run test:unit`. - Verified `npm run build` succeeds locally. - Verified `_headers` and `_redirects` are present and valid in `dist/`. This commit addresses the CI failures reported by the user, including the `agent-review` failure and likely resolving the associated 'Deploy failed' checks. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
1e0a94509e
commit
79ad3c4709
2 files changed
+6
No files matched your search
@@ -49,6 +49,9 @@ test("batchFetchProfiles handles fast and failing relays", async () => {
|
||||
const originalRelays = Array.isArray(nostrClient.relays)
|
||||
? [...nostrClient.relays]
|
||||
: [];
|
||||
const originalReadRelays = Array.isArray(nostrClient.readRelays)
|
||||
? [...nostrClient.readRelays]
|
||||
: nostrClient.readRelays;
|
||||
const originalWriteRelays = Array.isArray(nostrClient.writeRelays)
|
||||
? [...nostrClient.writeRelays]
|
||||
: nostrClient.writeRelays;
|
||||
@@ -57,6 +60,7 @@ test("batchFetchProfiles handles fast and failing relays", async () => {
|
||||
const poolListCalls = [];
|
||||
|
||||
nostrClient.relays = [FAST_RELAY, FAIL_RELAY];
|
||||
nostrClient.readRelays = [FAST_RELAY, FAIL_RELAY];
|
||||
nostrClient.writeRelays = [FAST_RELAY, FAIL_RELAY];
|
||||
nostrClient.pool = {
|
||||
list: (relays, filters) => {
|
||||
@@ -92,6 +96,7 @@ test("batchFetchProfiles handles fast and failing relays", async () => {
|
||||
});
|
||||
} finally {
|
||||
nostrClient.relays = originalRelays;
|
||||
nostrClient.readRelays = originalReadRelays;
|
||||
nostrClient.writeRelays = originalWriteRelays;
|
||||
nostrClient.pool = originalPool;
|
||||
}
|
||||
|
||||
@@ -275,6 +275,7 @@ function createController(options = {}) {
|
||||
},
|
||||
publish: async () => ({ ok: true }),
|
||||
on: () => () => {},
|
||||
load: async () => {},
|
||||
};
|
||||
|
||||
const hashtagPreferences = {
|
||||
|
||||
Reference in new issue
Block a user