Remove tests for member create and edit
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2024-08-31 23:14:13 +02:00
parent 02684502f1
commit 9f97d37cc3
2 changed files with 0 additions and 144 deletions

View File

@ -1,54 +0,0 @@
<?php
namespace Tests\Feature\Member;
use App\Activity;
use App\Country;
use App\Subactivity;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class CreateTest extends TestCase
{
use DatabaseTransactions;
public function setUp(): void
{
parent::setUp();
$this->withoutExceptionHandling();
$this->login()->loginNami();
Country::factory()->create(['name' => 'Deutschland']);
}
public function testItDisplaysCreatePage(): void
{
$activity = Activity::factory()->inNami(5)->hasAttached(Subactivity::factory()->inNami(23)->name('Biber'))->name('€ Mitglied')->create();
$subactivity = $activity->subactivities->first();
$response = $this->get(route('member.create'));
$this->assertInertiaHas('Biber', $response, "meta.formSubactivities.{$activity->id}.{$subactivity->id}");
$this->assertInertiaHas('€ Mitglied', $response, "meta.formActivities.{$activity->id}");
$this->assertInertiaHas(['name' => 'E-Mail', 'id' => 'E-Mail'], $response, 'meta.billKinds.0');
$this->assertInertiaHas([
'efz' => null,
'ps_at' => null,
'more_ps_at' => null,
'without_education_at' => null,
'without_efz_at' => null,
'address' => '',
], $response, 'meta.default');
}
public function testItDoesntDisplayActivitiesAndSubactivitiesNotInNami(): void
{
Activity::factory()->hasAttached(Subactivity::factory()->name('Biber'))->name('€ Mitglied')->create();
$response = $this->get(route('member.create'));
$this->assertCount(0, $this->inertia($response, 'meta.formCreateSubactivities'));
$this->assertCount(0, $this->inertia($response, 'meta.formCreateActivities'));
}
}

View File

@ -1,90 +0,0 @@
<?php
namespace Tests\Feature\Member;
use App\Activity;
use App\Country;
use App\Member\Member;
use App\Subactivity;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class EditTest extends TestCase
{
use DatabaseTransactions;
public function setUp(): void
{
parent::setUp();
Country::factory()->create(['name' => 'Deutschland']);
}
public function testItDisplaysEditPage(): void
{
$this->withoutExceptionHandling();
$this->login()->loginNami();
$member = Member::factory()->defaults()->create(['salutation' => 'Doktor', 'firstname' => 'Max', 'comment' => 'Lorem bla']);
$activity = Activity::factory()->inNami(66)->hasAttached(Subactivity::factory()->inNami(56)->name('Biber'))->name('€ Mitglied')->create();
$subactivity = $activity->subactivities->first();
$response = $this->get(route('member.edit', ['member' => $member]));
$this->assertInertiaHas('Biber', $response, "meta.formSubactivities.{$activity->id}.{$subactivity->id}");
$this->assertInertiaHas('€ Mitglied', $response, "meta.formActivities.{$activity->id}");
$this->assertInertiaHas('Max', $response, 'data.firstname');
$this->assertInertiaHas('Doktor', $response, 'data.salutation');
$this->assertInertiaHas('Lorem bla', $response, 'data.comment');
$this->assertInertiaHas('edit', $response, 'mode');
$this->assertInertiaHas(false, $response, 'conflict');
$this->assertInertiaHas(['name' => 'E-Mail', 'id' => 'E-Mail'], $response, 'meta.billKinds.0');
}
public function testItDisplaysEducation(): void
{
$this->withoutExceptionHandling()->login()->loginNami();
$member = Member::factory()
->defaults()
->create([
'efz' => '2022-09-20',
'ps_at' => '2022-04-20',
'more_ps_at' => '2022-06-02',
'without_education_at' => '2022-06-03',
'without_efz_at' => '2022-06-04',
'recertified_at' => '2022-06-04',
'has_vk' => true,
'has_svk' => true,
'multiply_pv' => true,
'multiply_more_pv' => true,
]);
$response = $this->get(route('member.edit', ['member' => $member]));
$this->assertInertiaHas([
'efz' => '2022-09-20',
'ps_at' => '2022-04-20',
'more_ps_at' => '2022-06-02',
'without_education_at' => '2022-06-03',
'without_efz_at' => '2022-06-04',
'recertified_at' => '2022-06-04',
'has_vk' => true,
'has_svk' => true,
'multiply_pv' => true,
'multiply_more_pv' => true,
], $response, 'data');
}
public function testItDisplaysSystem(): void
{
$this->withoutExceptionHandling()->login()->loginNami();
$member = Member::factory()
->defaults()
->emailBillKind()
->create();
$response = $this->get(route('member.edit', ['member' => $member]));
$this->assertInertiaHas([
'bill_kind' => 'E-Mail',
], $response, 'data');
}
}