Update tests to reflect removal of reply authors and per-post permalinks
All checks were successful
CI / test (push) Successful in 49s
All checks were successful
CI / test (push) Successful in 49s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -145,13 +145,13 @@ class BlueskyThreadsTest extends TestCase {
|
|||||||
$this->assertStringContainsString('hockeyviz.com', $html);
|
$this->assertStringContainsString('hockeyviz.com', $html);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Both reply authors must appear in the rendered HTML. */
|
/** Reply post authors are not rendered; only quoted post authors are. */
|
||||||
public function testReplyAuthorsAreRendered(): void {
|
public function testReplyAuthorsAreRendered(): void {
|
||||||
$data = json_decode(file_get_contents(__DIR__ . '/fixtures/thread_3mhtk7awhrp26.json'), true);
|
$data = json_decode(file_get_contents(__DIR__ . '/fixtures/thread_3mhtk7awhrp26.json'), true);
|
||||||
$html = $this->call('renderThread', $data['thread'], true);
|
$html = $this->call('renderThread', $data['thread'], true);
|
||||||
|
|
||||||
$this->assertStringContainsString('example.bsky.social', $html, 'First reply author must be present');
|
$this->assertStringNotContainsString('example.bsky.social', $html, 'Reply author must not appear in thread posts');
|
||||||
$this->assertStringContainsString('hockeyfan.bsky.social', $html, 'Second reply author must be present');
|
$this->assertStringNotContainsString('hockeyfan.bsky.social', $html, 'Reply author must not appear in thread posts');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The quoted/embedded post inside the root is rendered via renderQuotedRecord. */
|
/** The quoted/embedded post inside the root is rendered via renderQuotedRecord. */
|
||||||
@@ -164,12 +164,13 @@ class BlueskyThreadsTest extends TestCase {
|
|||||||
'Quoted post text must be rendered as an embed');
|
'Quoted post text must be rendered as an embed');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Every post must include a "View on Bluesky" link pointing to the right URL. */
|
/** Quoted posts include a "View on Bluesky" link; thread posts do not. */
|
||||||
public function testViewOnBskyLinksArePresent(): void {
|
public function testViewOnBskyLinksArePresent(): void {
|
||||||
$data = json_decode(file_get_contents(__DIR__ . '/fixtures/thread_3mhtk7awhrp26.json'), true);
|
$data = json_decode(file_get_contents(__DIR__ . '/fixtures/thread_3mhtk7awhrp26.json'), true);
|
||||||
$html = $this->call('renderThread', $data['thread'], true);
|
$html = $this->call('renderThread', $data['thread'], true);
|
||||||
|
|
||||||
$this->assertStringContainsString('3mhtk7awhrp26', $html, 'Root post rkey must appear in a Bluesky link');
|
$this->assertStringNotContainsString('3mhtk7awhrp26', $html, 'Thread post rkey must not appear as a permalink');
|
||||||
|
$this->assertStringContainsString('3mhtjo3rtkn26', $html, 'Quoted post rkey must appear in its View on Bluesky link');
|
||||||
$this->assertStringContainsString('View on Bluesky', $html);
|
$this->assertStringContainsString('View on Bluesky', $html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user