Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

testing gap for database adapters? #1902

Copy link
Copy link
@lwhiteley

Description

@lwhiteley
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.