Images can be uploaded with alt text

This means associating images to notes via a pivot table, we also finish
off the migration of medai from S3.
This commit is contained in:
Jonny Barnes 2026-01-04 10:07:25 +00:00
commit 9e788e0fe8
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
9 changed files with 200 additions and 19 deletions

View file

@ -434,4 +434,21 @@ class NotesTest extends TestCase
$this->assertSame($expected, $note->note);
}
#[Test]
public function note_can_have_media_with_alt_text(): void
{
$note = Note::factory()->create();
$media = Media::factory()->create();
$note->media()->attach($media->id, [
'alt_text' => 'Test alt text',
'order' => 0,
]);
$note->refresh();
$this->assertCount(1, $note->media);
$this->assertEquals('Test alt text', $note->media->first()->pivot->alt_text);
}
}