Skip to content

Add is_extended_promotional to components output + filters#128

Closed
gavin-openops wants to merge 2 commits intotscircuit:mainfrom
gavin-openops:bounty-92-extended-promotional
Closed

Add is_extended_promotional to components output + filters#128
gavin-openops wants to merge 2 commits intotscircuit:mainfrom
gavin-openops:bounty-92-extended-promotional

Conversation

@gavin-openops
Copy link

/claim #92

Summary

  • add is_extended_promotional to the components/v_components TypeScript db model
  • expose is_extended_promotional in /components/list JSON output
  • add is_extended_promotional query param filtering in the components list route
  • add UI checkbox for manual filtering
  • extend components route tests to cover output shape and filter param support

Notes

  • Kept changes minimal and scoped to components list/query path.
  • Also selected preferred explicitly in components query since it is referenced in mapped output.

Comment on lines +15 to +22
test("GET /components/list supports is_extended_promotional filter", async () => {
const { axios } = await getTestServer()
const res = await axios.get(
"/components/list?json=true&is_extended_promotional=true",
)

expect(res.data).toHaveProperty("components")
expect(Array.isArray(res.data.components)).toBe(true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test file now contains 2 test() functions, which violates the rule that a *.test.ts file may have AT MOST one test(...). After adding the second test, the file should be split into multiple numbered files such as 'list1.test.ts' and 'list2.test.ts'.

Spotted by Graphite (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@gavin-openops
Copy link
Author

Thanks — fixed.

I split the tests into numbered files to satisfy the one-test-per-file rule:

  • tests/routes/components/list1.test.ts
  • tests/routes/components/list2.test.ts

Pushed in commit d9cc67e.

@gavin-openops
Copy link
Author

Closing this to avoid duplicate bounty submissions for issue #92. Keeping #129 as the active PR because it includes the route + API search filter coverage in one place. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant