test(live): 7 tests for the Live polish work
Covers Private visibility acceptance, ended-state Watch page shows "Stream ended" (and omits the "Waiting for the broadcast" placeholder from the connection JS), channel-name link resolves to the user's channel URL, chat poll returns messages newer than ?since=, chat send rejects guests (401), chat send rejects offline streams (422), and private-stream chat 404s for non-owners. Also broadens LiveStream::isWatchableBy to keep public/unlisted streams permalinked after they end — viewers now see the Stream Ended card and the Watch Replay CTA instead of a hard 404. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This commit is contained in:
1 parent
5bf1128196
commit
8fef257c86
3 files changed
+169
-1
No files matched your search
@@ -124,7 +124,15 @@ class LiveStream extends Model
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->isLive() && in_array($this->visibility, ['public', 'unlisted'], true);
|
||||
// Visibility first — private streams stay owner-only no matter what.
|
||||
if (! in_array($this->visibility, ['public', 'unlisted'], true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Live streams are watchable while they're on; ended streams remain
|
||||
// permalinked so viewers see "Stream ended" and the replay CTA
|
||||
// instead of a hard 404.
|
||||
return $this->isLive() || $this->status === self::STATUS_ENDED;
|
||||
}
|
||||
|
||||
/* ---------------- Publish credential ---------------- */
|
||||
|
||||
Reference in new issue
Block a user