Compare commits

..

2 Commits

Author SHA1 Message Date
06067c0ff3 Update tests to reflect removal of reply authors and per-post permalinks
All checks were successful
CI / test (push) Successful in 49s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:05:24 -03:00
8a707f6c71 Add PostToolUse hook to run PHPUnit tests after every code edit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 11:08:02 -03:00
2 changed files with 21 additions and 5 deletions

View File

@@ -4,5 +4,20 @@
"WebFetch(domain:docs.bsky.app)", "WebFetch(domain:docs.bsky.app)",
"Bash(tea actions:*)" "Bash(tea actions:*)"
] ]
},
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "vendor/bin/phpunit",
"timeout": 60,
"statusMessage": "Running PHPUnit tests..."
}
]
}
]
} }
} }

View File

@@ -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);
} }