Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Simoneu01 committed Sep 10, 2023
1 parent 76b283f commit 1f5d77a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class Post extends Model
'banner',
'content',
'published_at',
'blog_author_id',
'blog_category_id',
];

/**
Expand Down
4 changes: 4 additions & 0 deletions tests/ResourceTests/CategoryTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Illuminate\Support\Str;
use Stephenjude\FilamentBlog\Models\Category;
use Stephenjude\FilamentBlog\Resources\CategoryResource;

Expand All @@ -21,6 +22,9 @@
'description' => $newData->description,
'is_visible' => $newData->is_visible,
])
->assertFormSet([
'slug' => Str::slug($newData->name),
])
->call('create')
->assertHasNoFormErrors();

Expand Down
5 changes: 4 additions & 1 deletion tests/ResourceTests/PostTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Illuminate\Support\Str;
use Stephenjude\FilamentBlog\Models\Author;
use Stephenjude\FilamentBlog\Models\Post;
use Stephenjude\FilamentBlog\Resources\PostResource;
Expand All @@ -24,12 +25,14 @@
livewire(PostResource\Pages\CreatePost::class)
->fillForm([
'title' => $newData->title,
'slug' => $newData->slug,
'excerpt' => $newData->excerpt,
'content' => $newData->content,
'blog_author_id' => $newData->author->getKey(),
'blog_category_id' => $newData->category->getKey(),
])
->assertFormSet([
'slug' => Str::slug($newData->title),
])
->call('create')
->assertHasNoFormErrors();

Expand Down

0 comments on commit 1f5d77a

Please sign in to comment.