storing analytics data

This commit is contained in:
2026-02-27 09:46:51 +01:00
parent 15b7b77d20
commit f0cca76eb3
57 changed files with 3478 additions and 466 deletions

View File

@@ -5,6 +5,7 @@ type Fixture = {
email: string
password: string
conversation_id: number
latest_message_id: number
}
function seedMessagingFixture(): Fixture {
@@ -46,7 +47,7 @@ function seedMessagingFixture(): Fixture {
"$last = Message::create(['conversation_id' => $conversation->id, 'sender_id' => $owner->id, 'body' => 'Seed latest from owner']);",
"$conversation->update(['last_message_at' => $last->created_at]);",
"ConversationParticipant::where('conversation_id', $conversation->id)->where('user_id', $peer->id)->update(['last_read_at' => Carbon::parse($last->created_at)->addSeconds(15)]);",
"echo json_encode(['email' => $owner->email, 'password' => 'password', 'conversation_id' => $conversation->id]);",
"echo json_encode(['email' => $owner->email, 'password' => 'password', 'conversation_id' => $conversation->id, 'latest_message_id' => $last->id]);",
].join(' ')
const raw = execFileSync('php', ['artisan', 'tinker', `--execute=${script}`], {
@@ -106,7 +107,7 @@ test.describe('Messaging UI', () => {
await login(page, fixture)
await page.goto(`/messages/${fixture.conversation_id}`)
await expect(page.locator('text=Seed latest from owner')).toBeVisible()
await expect(page.locator(`#message-${fixture.latest_message_id}`)).toContainText('Seed latest from owner')
await expect(page.locator('text=/^Seen\\s.+\\sago$/')).toBeVisible()
})
})