fix(test): add deterministic order values in SongPdfTest
Specify explicit order values for SongGroup factories to avoid unique constraint violations on the composite (song_id, order) key when faker generates duplicate random values.
This commit is contained in:
parent
af0c72ebcc
commit
149389a382
|
|
@ -264,12 +264,14 @@
|
||||||
'song_id' => $song->id,
|
'song_id' => $song->id,
|
||||||
'name' => 'Strophe 1',
|
'name' => 'Strophe 1',
|
||||||
'color' => '#3b82f6',
|
'color' => '#3b82f6',
|
||||||
|
'order' => 1,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$chorus = SongGroup::factory()->create([
|
$chorus = SongGroup::factory()->create([
|
||||||
'song_id' => $song->id,
|
'song_id' => $song->id,
|
||||||
'name' => 'Refrain',
|
'name' => 'Refrain',
|
||||||
'color' => '#ef4444',
|
'color' => '#ef4444',
|
||||||
|
'order' => 2,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
SongSlide::factory()->create([
|
SongSlide::factory()->create([
|
||||||
|
|
@ -332,6 +334,7 @@
|
||||||
$group = SongGroup::factory()->create([
|
$group = SongGroup::factory()->create([
|
||||||
'song_id' => $song->id,
|
'song_id' => $song->id,
|
||||||
'name' => 'Verse',
|
'name' => 'Verse',
|
||||||
|
'order' => 1,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
SongSlide::factory()->create([
|
SongSlide::factory()->create([
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue