Implement academy analytics, billing, and web stories updates
This commit is contained in:
@@ -88,7 +88,11 @@ it('renders discussion forum structured data on forum topic pages', function ():
|
||||
->assertOk()
|
||||
->assertSee('application/ld+json', false)
|
||||
->assertSee('DiscussionForumPosting', false)
|
||||
->assertSee('<script type="application/ld+json">{"@context":"https://schema.org","@type":"DiscussionForumPosting"', false)
|
||||
->assertSee('"comment":[{"@type":"Comment"', false)
|
||||
->assertSee('itemtype="https://schema.org/DiscussionForumPosting"', false)
|
||||
->assertSee('itemprop="author"', false)
|
||||
->assertSee('itemprop="text"', false)
|
||||
->assertSee('itemprop="comment"', false)
|
||||
->assertSee('itemtype="https://schema.org/Comment"', false)
|
||||
->assertSee('itemprop="headline"', false)
|
||||
@@ -101,6 +105,127 @@ it('renders discussion forum structured data on forum topic pages', function ():
|
||||
->assertSee(route('profile.show', ['username' => 'forumreplier']), false);
|
||||
});
|
||||
|
||||
it('falls back to the topic title when the opening post has no body', function (): void {
|
||||
$author = User::query()->create([
|
||||
'username' => 'forumfallbackauthor',
|
||||
'username_changed_at' => now()->subDays(120),
|
||||
'last_username_change_at' => now()->subDays(120),
|
||||
'onboarding_step' => 'complete',
|
||||
'name' => 'Forum Fallback Author',
|
||||
'email' => 'forumfallbackauthor@example.com',
|
||||
'email_verified_at' => now(),
|
||||
'password' => 'password',
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$category = ForumCategory::query()->create([
|
||||
'name' => 'Forum SEO',
|
||||
'title' => 'Forum SEO',
|
||||
'slug' => 'forum-seo-fallback',
|
||||
'description' => 'SEO discussion category',
|
||||
'is_active' => true,
|
||||
'position' => 1,
|
||||
]);
|
||||
|
||||
$board = ForumBoard::query()->create([
|
||||
'category_id' => $category->id,
|
||||
'title' => 'Technical SEO',
|
||||
'slug' => 'technical-seo-fallback',
|
||||
'description' => 'Technical SEO board',
|
||||
'is_active' => true,
|
||||
'position' => 1,
|
||||
]);
|
||||
|
||||
$topic = ForumTopic::query()->create([
|
||||
'board_id' => $board->id,
|
||||
'user_id' => $author->id,
|
||||
'title' => 'Sparse topic body',
|
||||
'slug' => 'sparse-topic-body',
|
||||
'views' => 7,
|
||||
'replies_count' => 0,
|
||||
'last_post_at' => now(),
|
||||
]);
|
||||
|
||||
ForumPost::query()->create([
|
||||
'thread_id' => $topic->id,
|
||||
'topic_id' => $topic->id,
|
||||
'user_id' => $author->id,
|
||||
'content' => '',
|
||||
'created_at' => now()->subHour(),
|
||||
'updated_at' => now()->subHour(),
|
||||
]);
|
||||
|
||||
$this->get(route('forum.topic.show', ['topic' => $topic->slug]))
|
||||
->assertOk()
|
||||
->assertSee('itemtype="https://schema.org/DiscussionForumPosting"', false)
|
||||
->assertSee('itemprop="author"', false)
|
||||
->assertSee('itemprop="text"', false)
|
||||
->assertSee('Sparse topic body', false)
|
||||
->assertSee('No comments yet.', false)
|
||||
->assertSee(route('profile.show', ['username' => 'forumfallbackauthor']), false);
|
||||
});
|
||||
|
||||
it('falls back to a default author when the topic author is missing', function (): void {
|
||||
$deletedAuthor = User::query()->create([
|
||||
'username' => 'forumdeletedauthor',
|
||||
'username_changed_at' => now()->subDays(120),
|
||||
'last_username_change_at' => now()->subDays(120),
|
||||
'onboarding_step' => 'complete',
|
||||
'name' => 'Deleted Forum Author',
|
||||
'email' => 'forumdeletedauthor@example.com',
|
||||
'email_verified_at' => now(),
|
||||
'password' => 'password',
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$category = ForumCategory::query()->create([
|
||||
'name' => 'Forum Missing Author',
|
||||
'title' => 'Forum Missing Author',
|
||||
'slug' => 'forum-missing-author',
|
||||
'description' => 'Category for orphaned forum topics',
|
||||
'is_active' => true,
|
||||
'position' => 1,
|
||||
]);
|
||||
|
||||
$board = ForumBoard::query()->create([
|
||||
'category_id' => $category->id,
|
||||
'title' => 'Missing Author Board',
|
||||
'slug' => 'missing-author-board',
|
||||
'description' => 'Board for orphaned forum topics',
|
||||
'is_active' => true,
|
||||
'position' => 1,
|
||||
]);
|
||||
|
||||
$topic = ForumTopic::query()->create([
|
||||
'board_id' => $board->id,
|
||||
'user_id' => $deletedAuthor->id,
|
||||
'title' => 'Missing author topic',
|
||||
'slug' => 'missing-author-topic',
|
||||
'views' => 3,
|
||||
'replies_count' => 0,
|
||||
'last_post_at' => now(),
|
||||
]);
|
||||
|
||||
ForumPost::query()->create([
|
||||
'thread_id' => $topic->id,
|
||||
'topic_id' => $topic->id,
|
||||
'user_id' => $deletedAuthor->id,
|
||||
'content' => '',
|
||||
'created_at' => now()->subHour(),
|
||||
'updated_at' => now()->subHour(),
|
||||
]);
|
||||
|
||||
$deletedAuthor->delete();
|
||||
|
||||
$this->get(route('forum.topic.show', ['topic' => $topic->slug]))
|
||||
->assertOk()
|
||||
->assertSee('DiscussionForumPosting', false)
|
||||
->assertSee('"author":{"@type":"Person","name":"Skinbase"}', false)
|
||||
->assertSee('"text":"Missing author topic"', false)
|
||||
->assertSee('"comment":[{"@type":"Comment"', false)
|
||||
->assertSee('No comments yet.', false);
|
||||
});
|
||||
|
||||
it('renders item list microdata on forum board pages', function (): void {
|
||||
$author = User::query()->create([
|
||||
'username' => 'boardauthor',
|
||||
|
||||
Reference in New Issue
Block a user