Fixed tests

This commit is contained in:
philipp lang 2023-06-15 00:12:20 +02:00
parent 48d9d9cc92
commit a434388bcb
2 changed files with 6 additions and 6 deletions

View File

@ -29,17 +29,17 @@ class StoreTest extends TestCase
Member::factory()->defaults()->has(Membership::factory()->inLocal('Leiter*in', 'Wölfling'))->create(['email' => 'jane@example.com']);
$activityId = Activity::first()->id;
$response = $this->postJson('/api/maildispatcher', [
$response = $this->postJson('/maildispatcher', [
'name' => 'test',
'gateway_id' => $gateway->id,
'filter' => ['activity_id' => $activityId],
'filter' => ['activity_ids' => [$activityId]],
]);
$response->assertStatus(201);
$this->assertDatabaseHas('maildispatchers', [
'name' => 'test',
'gateway_id' => $gateway->id,
'filter' => "{\"activity_id\":{$activityId}}",
'filter' => "{\"activity_ids\":[{$activityId}]}",
]);
$dispatcher = Maildispatcher::first();
$this->assertDatabaseCount('localmaildispatchers', 1);

View File

@ -194,12 +194,12 @@ class IndexTest extends TestCase
Member::factory()->defaults()->for($group1)->create();
Member::factory()->defaults()->for($group1)->create();
$oneResponse = $this->callFilter('member.index', ['group_id' => $group1->id]);
$twoResponse = $this->callFilter('member.index', ['group_id' => $group2->id]);
$oneResponse = $this->callFilter('member.index', ['group_ids' => [$group1->id]]);
$twoResponse = $this->callFilter('member.index', ['group_ids' => [$group2->id]]);
$this->assertCount(3, $this->inertia($oneResponse, 'data.data'));
$this->assertCount(0, $this->inertia($twoResponse, 'data.data'));
$this->assertInertiaHas($group1->id, $oneResponse, 'data.meta.filter.group_id');
$this->assertInertiaHas([$group1->id], $oneResponse, 'data.meta.filter.group_ids');
}
public function testItFiltersForAusstand(): void