From a0a02e736ec55db4f143672096073a47135e0fd9 Mon Sep 17 00:00:00 2001
From: George Repiev <33565251+ega22a@users.noreply.github.com>
Date: Fri, 31 May 2024 05:18:17 +0500
Subject: [PATCH] Visual addition in Boolean component (#2838)
* Make some pretty space in Boolean component
* BooleanTest Unit Test Update
---
src/Screen/Components/Cells/Boolean.php | 2 +-
tests/Unit/Cells/BooleanTest.php | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/Screen/Components/Cells/Boolean.php b/src/Screen/Components/Cells/Boolean.php
index 467765aff..f8b48ef41 100644
--- a/src/Screen/Components/Cells/Boolean.php
+++ b/src/Screen/Components/Cells/Boolean.php
@@ -34,7 +34,7 @@ public function __construct(?bool $value, ?string $true = null, ?string $false =
*/
public function render()
{
- $class = $this->value ? 'text-success' : 'text-danger';
+ $class = 'me-1 '.($this->value ? 'text-success' : 'text-danger');
$label = $this->value ? $this->true : $this->false;
return "●".$label;
diff --git a/tests/Unit/Cells/BooleanTest.php b/tests/Unit/Cells/BooleanTest.php
index 60e1a4cec..2e5211b82 100644
--- a/tests/Unit/Cells/BooleanTest.php
+++ b/tests/Unit/Cells/BooleanTest.php
@@ -13,28 +13,28 @@ public function testRenderBooleanComponent(): void
{
$component = new Boolean(true);
- $this->assertEquals("●", $component->render());
+ $this->assertEquals("●", $component->render());
$component = new Boolean(false);
- $this->assertEquals("●", $component->render());
+ $this->assertEquals("●", $component->render());
}
public function testRenderBooleanWithNullComponent(): void
{
$component = new Boolean(null);
- $this->assertEquals("●", $component->render());
+ $this->assertEquals("●", $component->render());
}
public function testRenderBooleanWithLabelComponent(): void
{
$component = new Boolean(true, true: 'Enabled', false: 'Disabled');
- $this->assertEquals("●Enabled", $component->render());
+ $this->assertEquals("●Enabled", $component->render());
$component = new Boolean(false, true: 'Enabled', false: 'Disabled');
- $this->assertEquals("●Disabled", $component->render());
+ $this->assertEquals("●Disabled", $component->render());
}
}