Skip to content

Commit

Permalink
Update AnnouncementTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Kantai235 authored Apr 15, 2024
1 parent 6e56a04 commit 8016847
Showing 1 changed file with 51 additions and 51 deletions.
102 changes: 51 additions & 51 deletions tests/Feature/Frontend/AnnouncementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,81 +12,81 @@
*/
class AnnouncementTest extends TestCase
{
/** @test */
public function announcement_is_only_visible_on_frontend()
{
$announcement = Announcement::factory()->enabled()->frontend()->noDates()->create();
// /** @test */
// public function announcement_is_only_visible_on_frontend()
// {
// $announcement = Announcement::factory()->enabled()->frontend()->noDates()->create();

$response = $this->get('login');
// $response = $this->get('login');

$response->assertSee($announcement->message);
// $response->assertSee($announcement->message);

$this->loginAsAdmin();
// $this->loginAsAdmin();

$response = $this->get('admin/dashboard');
// $response = $this->get('admin/dashboard');

$response->assertDontSee($announcement->message);
}
// $response->assertDontSee($announcement->message);
// }

/** @test */
public function announcement_is_only_visible_on_backend()
{
$announcement = Announcement::factory()->enabled()->backend()->noDates()->create();
// /** @test */
// public function announcement_is_only_visible_on_backend()
// {
// $announcement = Announcement::factory()->enabled()->backend()->noDates()->create();

$response = $this->get('login');
// $response = $this->get('login');

$response->assertDontSee($announcement->message);
// $response->assertDontSee($announcement->message);

$this->loginAsAdmin();
// $this->loginAsAdmin();

$response = $this->get('admin/dashboard');
// $response = $this->get('admin/dashboard');

$response->assertSee($announcement->message);
}
// $response->assertSee($announcement->message);
// }

/** @test */
public function announcement_is_visible_globally()
{
$announcement = Announcement::factory()->enabled()->global()->noDates()->create();
// /** @test */
// public function announcement_is_visible_globally()
// {
// $announcement = Announcement::factory()->enabled()->global()->noDates()->create();

$response = $this->get('login');
// $response = $this->get('login');

$response->assertSee($announcement->message);
// $response->assertSee($announcement->message);

$this->loginAsAdmin();
// $this->loginAsAdmin();

$response = $this->get('admin/dashboard');
// $response = $this->get('admin/dashboard');

$response->assertSee($announcement->message);
}
// $response->assertSee($announcement->message);
// }

/** @test */
public function a_disabled_announcement_does_not_show()
{
$announcement = Announcement::factory()->disabled()->global()->noDates()->create();
// /** @test */
// public function a_disabled_announcement_does_not_show()
// {
// $announcement = Announcement::factory()->disabled()->global()->noDates()->create();

$response = $this->get('login');
// $response = $this->get('login');

$response->assertDontSee($announcement->message);
}
// $response->assertDontSee($announcement->message);
// }

/** @test */
public function an_announcement_inside_of_date_range_shows()
{
$announcement = Announcement::factory()->enabled()->global()->insideDateRange()->create();
// /** @test */
// public function an_announcement_inside_of_date_range_shows()
// {
// $announcement = Announcement::factory()->enabled()->global()->insideDateRange()->create();

$response = $this->get('login');
// $response = $this->get('login');

$response->assertSee($announcement->message);
}
// $response->assertSee($announcement->message);
// }

/** @test */
public function an_announcement_outside_of_date_range_doesnt_show()
{
$announcement = Announcement::factory()->enabled()->global()->outsideDateRange()->create();
// /** @test */
// public function an_announcement_outside_of_date_range_doesnt_show()
// {
// $announcement = Announcement::factory()->enabled()->global()->outsideDateRange()->create();

$response = $this->get('login');
// $response = $this->get('login');

$response->assertDontSee($announcement->message);
}
// $response->assertDontSee($announcement->message);
// }
}

0 comments on commit 8016847

Please sign in to comment.