Skip to content

Commit bdb5aa5

Browse files
committed
Update tests
1 parent bf6650e commit bdb5aa5

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

tests/Feature/External/ToDataPackTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ public function test_export_creates_zip_file(): void
2929
$exporter = new ToDataPack($this->getFileMock());
3030
$filename = $exporter->process($membership->bar->id, 'datapack-test.zip');
3131

32-
$this->assertTrue(str_ends_with($filename, 'exports/1/datapack-test.zip'));
32+
$this->assertSame($filename, '1/datapack-test.zip');
3333
}
3434

3535
public function test_export_contains_files(): void
3636
{
37+
$exportMock = $this->getFileMock();
3738
Storage::fake('uploads');
3839

3940
$membership = $this->setupBarMembership();
@@ -55,8 +56,9 @@ public function test_export_contains_files(): void
5556
'file_extension' => $ingredientCocktailFile->extension(),
5657
]);
5758

58-
$exporter = new ToDataPack($this->getFileMock());
59+
$exporter = new ToDataPack($exportMock);
5960
$filename = $exporter->process($membership->bar->id, 'datapack-test.zip');
61+
$filename = $exportMock->disk()->path($filename);
6062

6163
$unzippedFilesDisk = Storage::fake('temp-datapack-unzip');
6264

tests/Feature/External/ToRecipeTypeTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ public function test_export_creates_zip_file(): void
2929
$exporter = new ToRecipeType($this->getFileMock());
3030
$filename = $exporter->process($membership->bar->id, 'recipes.zip');
3131

32-
$this->assertTrue(str_ends_with($filename, 'exports/1/recipes.zip'));
32+
$this->assertSame($filename, '1/recipes.zip');
3333
}
3434

3535
public function test_default_export_contains_schema_files(): void
3636
{
37+
$exportMock = $this->getFileMock();
3738
Storage::fake('uploads');
3839

3940
$membership = $this->setupBarMembership();
@@ -55,8 +56,9 @@ public function test_default_export_contains_schema_files(): void
5556
'file_extension' => $ingredientCocktailFile->extension(),
5657
]);
5758

58-
$exporter = new ToRecipeType($this->getFileMock());
59+
$exporter = new ToRecipeType($exportMock);
5960
$filename = $exporter->process($membership->bar->id, 'recipes.zip');
61+
$filename = $exportMock->disk()->path($filename);
6062

6163
$unzippedFilesDisk = Storage::fake('temp-recipes-unzip');
6264

tests/Feature/Http/ImportControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function test_import_csv_ingredients_from_file(): void
6565
'strength' => 40,
6666
'description' => 'Bitter liquer',
6767
'origin' => 'Italy',
68-
'color' => '#008800',
68+
'color' => null,
6969
'bar_id' => $membership->bar_id,
7070
'created_user_id' => $membership->user_id,
7171
]);

tests/Feature/Http/ShoppingListControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
use Tests\TestCase;
88
use Kami\Cocktail\Models\Ingredient;
99
use Kami\Cocktail\Models\UserShoppingList;
10+
use Kami\Cocktail\Models\Enums\UserRoleEnum;
1011
use Illuminate\Testing\Fluent\AssertableJson;
1112
use Illuminate\Foundation\Testing\RefreshDatabase;
12-
use Kami\Cocktail\Models\Enums\UserRoleEnum;
1313

1414
class ShoppingListControllerTest extends TestCase
1515
{

0 commit comments

Comments
 (0)