Skip to content

Commit 4bc5d87

Browse files
kennethphoughclaude
andcommitted
fix(test): DraftServiceTest missing required columns (never ran in CI)
Adding the test to the suite revealed it had never actually executed — its object creates omit required NOT NULL columns: - KytePage create (setUp + cross-account test) missing `s3key` - Function create missing `type` (The KyteScript create already included s3key — just the page/function ones were overlooked.) Pure test fixes; the DraftService prod code is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6f274cb commit 4bc5d87

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/DraftServiceTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected function setUp(): void
5151
$page = new \Kyte\Core\ModelObject(KytePage);
5252
$page->create([
5353
'title' => 'Draft Test Page',
54+
's3key' => 'draft-test-page.html',
5455
'state' => 1,
5556
'kyte_account' => $this->accountId,
5657
]);
@@ -164,7 +165,7 @@ public function testCrossAccountWriteIsDenied(): void
164165

165166
// A page id that does not belong to this account.
166167
$other = new \Kyte\Core\ModelObject(KytePage);
167-
$other->create(['title' => 'Other', 'state' => 1, 'kyte_account' => $this->accountId + 99999]);
168+
$other->create(['title' => 'Other', 's3key' => 'other-page.html', 'state' => 1, 'kyte_account' => $this->accountId + 99999]);
168169

169170
$result = $svc->writePart($S, (int)$other->id, 'html', 'x');
170171
$this->assertNull($result, 'writing to a page outside the account is denied');
@@ -180,6 +181,7 @@ public function testFunctionSurfaceAuthoring(): void
180181
$fn->create([
181182
'name' => 'al_draft_test_fn',
182183
'controller' => 1,
184+
'type' => 'custom',
183185
'code' => bzcompress('echo 1;', 9),
184186
'kyte_account' => $this->accountId,
185187
]);

0 commit comments

Comments
 (0)