Skip to content

Commit c53e32b

Browse files
committed
MAGE-1044 Assert replica ranking by sort attribute
1 parent ee9dc43 commit c53e32b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Test/Integration/Product/ReplicaIndexingTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function testStandardReplicaConfig(): void
9696

9797
// Assert standard replica ranking config
9898
$this->assertArrayHasKey('ranking', $replicaSettings);
99-
$this->assertContains("$sortDir($sortAttr)", $replicaSettings['ranking']);
99+
$this->assertEquals("$sortDir($sortAttr)", array_shift($replicaSettings['ranking']));
100100

101101
}
102102

@@ -154,6 +154,10 @@ public function testVirtualReplicaConfig(): void
154154
$this->assertArrayHasKey('primary', $replicaSettings);
155155
$this->assertEquals($indexName, $replicaSettings['primary']);
156156

157+
// Assert virtual replica ranking config
158+
$this->assertArrayHasKey('customRanking', $replicaSettings);
159+
$this->assertEquals("$sortDir($sortAttr)", array_shift($replicaSettings['customRanking']));
160+
157161
// Restore prior state (for this test only)
158162
$this->algoliaHelper->setSettings($indexName, $ogAlgoliaSettings);
159163
$this->setConfig('algoliasearch_instant/instant/is_instant_enabled', 0);

0 commit comments

Comments
 (0)