Skip to content

Commit

Permalink
The slug is now required... update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Dec 19, 2024
1 parent 72bd7fe commit 17a37f1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/Jobs/ImportItemJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,14 @@ public function it_imports_a_new_term()
'unique_field' => 'title',
'mappings' => [
'title' => ['key' => 'Title'],
'slug' => ['key' => 'Slug'],
],
'strategy' => ['create'],
]);

ImportItemJob::dispatch($import, [
'Title' => 'Statamic',
'Slug' => 'statamic',
]);

$term = Term::query()->where('title', 'Statamic')->first();
Expand Down Expand Up @@ -416,12 +418,14 @@ public function it_imports_a_new_term_with_a_specific_blueprint()
'unique_field' => 'title',
'mappings' => [
'title' => ['key' => 'Title'],
'slug' => ['key' => 'Slug'],
],
'strategy' => ['create'],
]);

ImportItemJob::dispatch($import, [
'Title' => 'Statamic',
'Slug' => 'statamic',
]);

$term = Term::query()->where('title', 'Statamic')->first();
Expand All @@ -442,12 +446,14 @@ public function it_doesnt_import_a_new_term_when_creation_is_disabled()
'unique_field' => 'title',
'mappings' => [
'title' => ['key' => 'Title'],
'slug' => ['key' => 'Slug'],
],
'strategy' => ['update'],
]);

ImportItemJob::dispatch($import, [
'Title' => 'Statamic',
'Slug' => 'statamic',
]);

$this->assertNull(Term::query()->where('title', 'Statamic')->first());
Expand All @@ -464,13 +470,15 @@ public function it_updates_an_existing_term()
'unique_field' => 'title',
'mappings' => [
'title' => ['key' => 'Title'],
'slug' => ['key' => 'Slug'],
'foo' => ['key' => 'Foo'],
],
'strategy' => ['update'],
]);

ImportItemJob::dispatch($import, [
'Title' => 'Statamic',
'Slug' => 'statamic',
'Foo' => 'Baz',
]);

Expand All @@ -493,13 +501,15 @@ public function it_doesnt_update_an_existing_term_when_updating_is_disabled()
'unique_field' => 'title',
'mappings' => [
'title' => ['key' => 'Title'],
'slug' => ['key' => 'Slug'],
'foo' => ['key' => 'Foo'],
],
'strategy' => ['create'],
]);

ImportItemJob::dispatch($import, [
'Title' => 'Statamic',
'Slug' => 'statamic',
'Foo' => 'Baz',
]);

Expand Down

0 comments on commit 17a37f1

Please sign in to comment.