diff --git a/packages/tables/docs/12-testing.md b/packages/tables/docs/12-testing.md index 62a7be4eb1..5024737623 100644 --- a/packages/tables/docs/12-testing.md +++ b/packages/tables/docs/12-testing.md @@ -638,6 +638,8 @@ it('can average values in a column', function () { The first argument is the column name, the second is the summarizer ID, and the third is the expected value. +Note that the expected and actual values are normalized, such that `123.12` is considered the same as `"123.12"`, and `['Fred', 'Jim']` is the same as `['Jim', 'Fred']`. + You may set a summarizer ID by passing it to the `make()` method: ```php diff --git a/packages/tables/src/Testing/TestsSummaries.php b/packages/tables/src/Testing/TestsSummaries.php index 27cdc9b4a0..042c1f4c45 100644 --- a/packages/tables/src/Testing/TestsSummaries.php +++ b/packages/tables/src/Testing/TestsSummaries.php @@ -39,7 +39,7 @@ public function assertTableColumnSummarySet(): Closure $livewireClass = $this->instance()::class; - Assert::assertSame( + Assert::assertEqualsCanonicalizing( $state, $actualState, message: "Failed asserting that summarizer [$summarizerId], for column [{$columnName}], on the [{$livewireClass}] component, is set.", @@ -73,7 +73,7 @@ public function assertTableColumnSummaryNotSet(): Closure $livewireClass = $this->instance()::class; - Assert::assertNotSame( + Assert::assertNotEqualsCanonicalizing( $state, $actualState, message: "Failed asserting that summarizer [$summarizerId], for column [{$columnName}], on the [{$livewireClass}] component, is not set.",