Skip to content

Commit

Permalink
Add Basic Tests for Loading Placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
lrljoe authored Oct 17, 2023
1 parent ae7a873 commit a22c668
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/Traits/Configuration/LoadingConfigurationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Tests\Traits\Configuration;

use Rappasoft\LaravelLivewireTables\Tests\TestCase;

class LoadingConfigurationTest extends TestCase
{
/** @test */
public function can_set_loading_placeholder_status_enabled(): void
{
$this->assertFalse($this->basicTable->hasDisplayLoadingPlaceholder());

$this->basicTable->setLoadingPlaceholderEnabled();

$this->assertTrue($this->basicTable->hasDisplayLoadingPlaceholder());

}

/** @test */
public function can_set_loading_placeholder_status_disabled(): void
{
$this->assertFalse($this->basicTable->hasDisplayLoadingPlaceholder());

$this->basicTable->setLoadingPlaceholderEnabled();

$this->assertTrue($this->basicTable->hasDisplayLoadingPlaceholder());

$this->basicTable->setLoadingPlaceholderDisabled();

$this->assertFalse($this->basicTable->hasDisplayLoadingPlaceholder());

}

}
23 changes: 23 additions & 0 deletions tests/Traits/Helpers/LoadingHelpersTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Tests\Traits\Helpers;

use Rappasoft\LaravelLivewireTables\Tests\TestCase;

class LoadingHelpersTest extends TestCase
{
/** @test */
public function can_get_loading_placeholder_status(): void
{
$this->assertFalse($this->basicTable->hasDisplayLoadingPlaceholder());

$this->basicTable->setLoadingPlaceholderEnabled();

$this->assertTrue($this->basicTable->getDisplayLoadingPlaceholder());

$this->assertTrue($this->basicTable->hasDisplayLoadingPlaceholder());

}


}

0 comments on commit a22c668

Please sign in to comment.