Skip to content

Commit 3801d0b

Browse files
committed
feat(cts): add delete by tag test
1 parent ea8f244 commit 3801d0b

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/test/scala/algolia/integration/DeleteByIntegrationTest.scala

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ package algolia.integration
2828
import algolia.AlgoliaDsl._
2929
import algolia.AlgoliaTest
3030
import algolia.objects.Query
31+
import algolia.responses.ObjectID
3132

3233
class DeleteByIntegrationTest extends AlgoliaTest {
3334

34-
val list: Seq[Value] = 1 to 100 map (i => Value(i, i.toString))
35+
val list: Seq[ValueTag] = 1 to 100 map (
36+
i => ValueTag(i, i.toString, Seq("algolia"))
37+
)
3538
val testDeleteBy: String = getTestIndexName("testDeleteBy")
3639

3740
before {
@@ -60,4 +63,20 @@ class DeleteByIntegrationTest extends AlgoliaTest {
6063

6164
}
6265

66+
describe("delete by query tag") {
67+
68+
val query = Query(tagFilters = Some(Seq("algolia")))
69+
70+
it("should delete with a query ") {
71+
val d = AlgoliaTest.client.execute {
72+
delete from testDeleteBy by query
73+
}
74+
75+
taskShouldBeCreatedAndWaitForIt(d, testDeleteBy)
76+
}
77+
78+
}
6379
}
80+
81+
case class ValueTag(int: Int, objectID: String, _tags: Seq[String])
82+
extends ObjectID

0 commit comments

Comments
 (0)