mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
- Fix `scripts/check-design-tokens.mjs` to allow a mobile breakpoint. - Add Dev Container documentation to `CONTRIBUTING.md`. - Fix missing dependency injection in `tests/helpers/moderation-test-helpers.mjs` to resolve some unit test failures in a fresh environment.
306 lines
8.9 KiB
Plaintext
306 lines
8.9 KiB
Plaintext
|
|
> [email protected] test:unit
|
|
> node scripts/run-unit-tests.mjs
|
|
|
|
|
|
→ Running tests/app-batch-fetch-profiles.test.mjs
|
|
[bitvid] Initialized nostr nip04 helpers.
|
|
[bitvid] Initialized nostr nip44 helpers.
|
|
[batchFetchProfiles] Failed to fetch profiles from relay wss://fail.example: Error: relay timed out
|
|
at Object.list (file:///app/tests/app-batch-fetch-profiles.test.mjs:80:31)
|
|
at file:///app/js/utils/profileBatchFetcher.js:115:10
|
|
at Array.map (<anonymous>)
|
|
at batchFetchProfilesFromRelays (file:///app/js/utils/profileBatchFetcher.js:112:75)
|
|
at TestContext.<anonymous> (file:///app/tests/app-batch-fetch-profiles.test.mjs:87:11)
|
|
at Test.runInAsyncScope (node:async_hooks:214:14)
|
|
at Test.run (node:internal/test_runner/test:1047:25)
|
|
at Test.start (node:internal/test_runner/test:944:17)
|
|
at startSubtestAfterBootstrap (node:internal/test_runner/harness:296:17)
|
|
TAP version 13
|
|
# Subtest: batchFetchProfiles handles fast and failing relays
|
|
ok 1 - batchFetchProfiles handles fast and failing relays
|
|
---
|
|
duration_ms: 7.977402
|
|
type: 'test'
|
|
...
|
|
1..1
|
|
# tests 1
|
|
# suites 0
|
|
# pass 1
|
|
# fail 0
|
|
# cancelled 0
|
|
# skipped 0
|
|
# todo 0
|
|
# duration_ms 22.241514
|
|
|
|
→ Running tests/app/channel-profile-moderation.test.mjs
|
|
[bitvid] Initialized nostr nip04 helpers.
|
|
[bitvid] Initialized nostr nip44 helpers.
|
|
[feedEngine/moderation] metadata.moderation updated {
|
|
stage: 'moderation',
|
|
videoId: 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv',
|
|
blockAutoplay: true,
|
|
blurThumbnail: true,
|
|
trustedCount: 2,
|
|
reportType: 'nudity',
|
|
hidden: false,
|
|
hideReason: null,
|
|
hideBypass: null
|
|
}
|
|
TAP version 13
|
|
# Subtest: renderChannelVideosFromList decorates videos before storing
|
|
ok 1 - renderChannelVideosFromList decorates videos before storing
|
|
---
|
|
duration_ms: 379.80434
|
|
type: 'test'
|
|
...
|
|
# Subtest: renderChannelVideosFromList applies moderation blur without existing metadata
|
|
ok 2 - renderChannelVideosFromList applies moderation blur without existing metadata
|
|
---
|
|
duration_ms: 45.289258
|
|
type: 'test'
|
|
...
|
|
# Subtest: applyChannelVisualBlur blurs banner and avatar when viewer mutes author
|
|
ok 3 - applyChannelVisualBlur blurs banner and avatar when viewer mutes author
|
|
---
|
|
duration_ms: 15.951023
|
|
type: 'test'
|
|
...
|
|
# Subtest: moderation override clears channel blur via event wiring
|
|
ok 4 - moderation override clears channel blur via event wiring
|
|
---
|
|
duration_ms: 45.789308
|
|
type: 'test'
|
|
...
|
|
# Subtest: channel header moderation badge reflects blur state and override actions
|
|
ok 5 - channel header moderation badge reflects blur state and override actions
|
|
---
|
|
duration_ms: 42.447356
|
|
type: 'test'
|
|
...
|
|
# Subtest: channel video cards update moderation state in place when summary changes
|
|
ok 6 - channel video cards update moderation state in place when summary changes
|
|
---
|
|
duration_ms: 25.597118
|
|
type: 'test'
|
|
...
|
|
1..6
|
|
# tests 6
|
|
# suites 0
|
|
# pass 6
|
|
# fail 0
|
|
# cancelled 0
|
|
# skipped 0
|
|
# todo 0
|
|
# duration_ms 568.177635
|
|
|
|
→ Running tests/app/hash-change-handler.test.mjs
|
|
TAP version 13
|
|
# Subtest: handleHashChange defaults to for-you when logged in
|
|
ok 1 - handleHashChange defaults to for-you when logged in
|
|
---
|
|
duration_ms: 75.772174
|
|
type: 'test'
|
|
...
|
|
# Subtest: handleHashChange defaults to most-recent-videos when logged out
|
|
ok 2 - handleHashChange defaults to most-recent-videos when logged out
|
|
---
|
|
duration_ms: 9.627833
|
|
type: 'test'
|
|
...
|
|
# Subtest: handleHashChange respects explicit view regardless of login state
|
|
ok 3 - handleHashChange respects explicit view regardless of login state
|
|
---
|
|
duration_ms: 10.030577
|
|
type: 'test'
|
|
...
|
|
1..3
|
|
# tests 3
|
|
# suites 0
|
|
# pass 3
|
|
# fail 0
|
|
# cancelled 0
|
|
# skipped 0
|
|
# todo 0
|
|
# duration_ms 108.647336
|
|
|
|
→ Running tests/app/hydrate-sidebar-navigation.test.mjs
|
|
[bitvid] Initialized nostr nip04 helpers.
|
|
[bitvid] Initialized nostr nip44 helpers.
|
|
TAP version 13
|
|
# Subtest: hydrateSidebarNavigation reveals chrome controls for authenticated viewers
|
|
ok 1 - hydrateSidebarNavigation reveals chrome controls for authenticated viewers
|
|
---
|
|
duration_ms: 118.594258
|
|
type: 'test'
|
|
...
|
|
# Subtest: hydrateSidebarNavigation hides chrome controls for logged-out viewers
|
|
ok 2 - hydrateSidebarNavigation hides chrome controls for logged-out viewers
|
|
---
|
|
duration_ms: 27.333658
|
|
type: 'test'
|
|
...
|
|
1..2
|
|
# tests 2
|
|
# suites 0
|
|
# pass 2
|
|
# fail 0
|
|
# cancelled 0
|
|
# skipped 0
|
|
# todo 0
|
|
# duration_ms 161.988571
|
|
|
|
→ Running tests/app/is-user-logged-in.test.mjs
|
|
[bitvid] Initialized nostr nip04 helpers.
|
|
[bitvid] Initialized nostr nip44 helpers.
|
|
TAP version 13
|
|
# Subtest: isUserLoggedIn returns false when no user pubkey is set
|
|
ok 1 - isUserLoggedIn returns false when no user pubkey is set
|
|
---
|
|
duration_ms: 1.780936
|
|
type: 'test'
|
|
...
|
|
# Subtest: isUserLoggedIn treats extension logins as authenticated
|
|
ok 2 - isUserLoggedIn treats extension logins as authenticated
|
|
---
|
|
duration_ms: 0.469339
|
|
type: 'test'
|
|
...
|
|
# Subtest: isUserLoggedIn guards against mismatched nostrClient state
|
|
ok 3 - isUserLoggedIn guards against mismatched nostrClient state
|
|
---
|
|
duration_ms: 0.229676
|
|
type: 'test'
|
|
...
|
|
# Subtest: isUserLoggedIn ignores anonymous session actor mismatches
|
|
ok 4 - isUserLoggedIn ignores anonymous session actor mismatches
|
|
---
|
|
duration_ms: 0.274654
|
|
type: 'test'
|
|
...
|
|
# Subtest: isUserLoggedIn rejects mismatched managed session actors
|
|
ok 5 - isUserLoggedIn rejects mismatched managed session actors
|
|
---
|
|
duration_ms: 0.278603
|
|
type: 'test'
|
|
...
|
|
1..5
|
|
# tests 5
|
|
# suites 0
|
|
# pass 5
|
|
# fail 0
|
|
# cancelled 0
|
|
# skipped 0
|
|
# todo 0
|
|
# duration_ms 35.209771
|
|
|
|
→ Running tests/app/moderation-overrides.test.mjs
|
|
[bitvid] Initialized nostr nip04 helpers.
|
|
[bitvid] Initialized nostr nip44 helpers.
|
|
TAP version 13
|
|
# Subtest: handleModerationOverride decorates stored and current videos then refreshes UI
|
|
not ok 1 - handleModerationOverride decorates stored and current videos then refreshes UI
|
|
---
|
|
duration_ms: 228.266794
|
|
type: 'test'
|
|
location: '/app/tests/app/moderation-overrides.test.mjs:27:1'
|
|
failureType: 'testCodeFailure'
|
|
error: |-
|
|
Expected values to be strictly equal:
|
|
+ actual - expected
|
|
|
|
+ undefined
|
|
- true
|
|
|
|
code: 'ERR_ASSERTION'
|
|
name: 'AssertionError'
|
|
expected: true
|
|
operator: 'strictEqual'
|
|
stack: |-
|
|
TestContext.<anonymous> (file:///app/tests/app/moderation-overrides.test.mjs:67:10)
|
|
async Test.run (node:internal/test_runner/test:1054:7)
|
|
async startSubtestAfterBootstrap (node:internal/test_runner/harness:296:3)
|
|
...
|
|
# Subtest: handleModerationOverride resumes deferred playback
|
|
not ok 2 - handleModerationOverride resumes deferred playback
|
|
---
|
|
duration_ms: 2.019286
|
|
type: 'test'
|
|
location: '/app/tests/app/moderation-overrides.test.mjs:75:1'
|
|
failureType: 'testCodeFailure'
|
|
error: |-
|
|
Expected values to be strictly equal:
|
|
+ actual - expected
|
|
|
|
+ {
|
|
+ magnet: '',
|
|
+ triggerProvided: false,
|
|
+ url: 'https://example.com/video.mp4',
|
|
+ videoId: 'dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd'
|
|
+ }
|
|
- null
|
|
|
|
code: 'ERR_ASSERTION'
|
|
name: 'AssertionError'
|
|
expected: ~
|
|
actual:
|
|
url: 'https://example.com/video.mp4'
|
|
magnet: ''
|
|
triggerProvided: false
|
|
videoId: 'dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd'
|
|
operator: 'strictEqual'
|
|
stack: |-
|
|
TestContext.<anonymous> (file:///app/tests/app/moderation-overrides.test.mjs:104:10)
|
|
async Test.run (node:internal/test_runner/test:1054:7)
|
|
async Test.processPendingSubtests (node:internal/test_runner/test:744:7)
|
|
...
|
|
# Subtest: handleModerationBlock requests a block, clears overrides, and refreshes hidden state
|
|
not ok 3 - handleModerationBlock requests a block, clears overrides, and refreshes hidden state
|
|
---
|
|
duration_ms: 2.784959
|
|
type: 'test'
|
|
location: '/app/tests/app/moderation-overrides.test.mjs:112:1'
|
|
failureType: 'testCodeFailure'
|
|
error: |-
|
|
Expected values to be strictly equal:
|
|
+ actual - expected
|
|
|
|
+ undefined
|
|
- true
|
|
|
|
code: 'ERR_ASSERTION'
|
|
name: 'AssertionError'
|
|
expected: true
|
|
operator: 'strictEqual'
|
|
stack: |-
|
|
TestContext.<anonymous> (file:///app/tests/app/moderation-overrides.test.mjs:202:10)
|
|
async Test.run (node:internal/test_runner/test:1054:7)
|
|
async Test.processPendingSubtests (node:internal/test_runner/test:744:7)
|
|
...
|
|
# Subtest: handleModerationBlock returns false when viewer is logged out
|
|
ok 4 - handleModerationBlock returns false when viewer is logged out
|
|
---
|
|
duration_ms: 2.057327
|
|
type: 'test'
|
|
...
|
|
1..4
|
|
# tests 4
|
|
# suites 0
|
|
# pass 1
|
|
# fail 3
|
|
# cancelled 0
|
|
# skipped 0
|
|
# todo 0
|
|
# duration_ms 267.221529
|
|
file:///app/scripts/run-unit-tests.mjs:68
|
|
reject(new Error(`${relativePath} failed with exit code ${code}`));
|
|
^
|
|
|
|
Error: tests/app/moderation-overrides.test.mjs failed with exit code 1
|
|
at ChildProcess.<anonymous> (file:///app/scripts/run-unit-tests.mjs:68:16)
|
|
at ChildProcess.emit (node:events:519:28)
|
|
at maybeClose (node:internal/child_process:1101:16)
|
|
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
|
|
|
|
Node.js v22.21.1
|