139 - Make the chart key uniqueness test assert real charts
This commit is contained in:
parent
90ecad22a7
commit
812c663529
1 changed files with 9 additions and 1 deletions
|
|
@ -347,14 +347,22 @@ public function test_it_keys_the_chart_on_its_data_so_a_range_change_replaces_it
|
|||
$this->assertNotSame($julyKey[1], $augustKey[1]);
|
||||
}
|
||||
|
||||
public function test_it_keys_each_chart_separately_when_their_payloads_match(): void
|
||||
public function test_it_gives_concurrently_rendered_charts_distinct_keys(): void
|
||||
{
|
||||
RouteArticle::factory()->create([
|
||||
'approval_status' => ApprovalStatusEnum::APPROVED,
|
||||
'publish_status' => PublishStatusEnum::PUBLISHED,
|
||||
'decided_at' => Carbon::parse('2026-07-10 12:00:00'),
|
||||
'updated_at' => Carbon::parse('2026-07-10 12:00:00'),
|
||||
]);
|
||||
|
||||
$fragments = $this->islandFragments(
|
||||
Livewire::test(Dashboard::class)->call('applyRange', '2026-07-01', '2026-07-31')
|
||||
);
|
||||
|
||||
preg_match_all('/wire:key="(chart-[a-f0-9]+)"/', $fragments, $keys);
|
||||
|
||||
$this->assertCount(2, $keys[1]);
|
||||
$this->assertSame($keys[1], array_unique($keys[1]));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue