Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor data tests to cover all supported content types #656

Open
lkitching opened this issue Feb 27, 2023 · 0 comments
Open

Refactor data tests to cover all supported content types #656

lkitching opened this issue Feb 27, 2023 · 0 comments

Comments

@lkitching
Copy link
Contributor

The draftset data endpoints support uploading or requesting data in various content types. However, many of the tests only test these routes with a single content type, either directly or by using a test hepler function which hard-codes the content type. See for example get-draftset-quads-data which fetches the data using the get-user-draftset-quads-through-api hepler, which specifies the n-quads content type.

It should be possible to test all supported content types within each of these tests by refactoring the tests and helpers to be parameterised by content type and looping over all supported media types e.g.

(t/deftest get-draftset-quads-data
  ;; create draft and append data
  (doseq [format conneg/show-data-formats]
    (t/testing (str "Get data in format: " format)
      (let [quads (help/get-user-draftset-quads-through-api hander draftest test-editor format)
             expected ...]
        (t/is (= (set quads) (set expected)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant