-
-
Notifications
You must be signed in to change notification settings - Fork 795
Closed
Description
Steps to reproduce
adapter test cases do not cover the total count in cases where the data is filtered but data set is actually larger
I recently wrote an adapter and the pagination was returning the full count in the database even when filtered but all test cases passed anyway.
is this the expected behaviour or a test gap?
for eg.
Dataset:
[
{
"type":"urgent",
"message":"tester is testing"
},
{
"type":"not-urgent",
"message":"tester is testing"
},
{
"type":"urgent",
"message":"tester is testing"
},
{
"type":"not-urgent",
"message":"tester is testing"
}
]Query: /messages?type=urgent
What should be the expected result?
Result 1: Test passes 🆗
{
"total": 4,
"data":[
{
"type":"urgent",
"message":"tester is testing"
},
{
"type":"urgent",
"message":"tester is testing"
}
]
}Result 2: Test passes 🆗 ..
i believe this is the correct one but in reality the tests allow both
{
"total": 2,
"data": [
{
"type":"urgent",
"message":"tester is testing"
},
{
"type":"urgent",
"message":"tester is testing"
}
]
}
``Reactions are currently unavailable