Skip to content

test(compareBar): add common tests - #7307

Draft
Haroenv wants to merge 1 commit into
masterfrom
test/compare-common-tests
Draft

Haroenv wants to merge 1 commit into
masterfrom
test/compare-common-tests

Conversation

@Haroenv

@Haroenv Haroenv commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds cross-flavor common tests for the compare connector / useCompare and the compareBar widget, for InstantSearch.js and React InstantSearch. Vue has no compare flavor, so both suites are registered there as skipped, the same way PromptSuggestions and FilterSuggestions are.

  • tests/common/widgets/compare-bar/: the CompareBar widget common tests suite. The setup mounts the bar, a sibling compare consumer that renders a toggle button per product, and a chat on the same index.
  • tests/common/connectors/compare/: the Compare connector common tests suite, driven through a custom render that exposes the render state.

Result

  • Widget suite covers: empty selection renders nothing; adding, removing and clearing through a sibling toggle, the bar's remove buttons and clear button; item labels (name, title, objectID); count text; compare button disabled below minItems with the hint; limit hint at maxItems; custom translations; clicking Compare opens the chat and sends the __ALGOLIA_COMPARISON_<id>__ placeholder with selected_products / comparison_configuration_id turn context and the x-algolia-referer: compare header; disabled button and missing chat send nothing.
  • Connector suite covers: defaults and custom limits, minItems / maxItems validation errors, add/remove/toggle/clear, duplicate and over-limit no-ops, canAddItems / canCompare, and compare() below minItems, without a configurationId and without a chat.
  • yarn jest common-widgets common-connectors, yarn lint:changed and yarn type-check pass.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 4 critical · 2 high

Alerts:

⚠ 6 issues (≤ 0 issues of at least high severity)

Results:
6 new issues

Category Results
Security 4 critical
2 high

View in Codacy

🟢 Metrics 78 complexity

Metric Results
Complexity 78

View in Codacy

TIP This summary will be updated as you push new changes.

@pkg-pr-new

pkg-pr-new Bot commented Oct 16, 2026

Copy link
Copy Markdown
More templates

algoliasearch-helper

npm i https://pkg.pr.new/algolia/instantsearch/algoliasearch-helper@7307

instantsearch-ui-components

npm i https://pkg.pr.new/algolia/instantsearch/instantsearch-ui-components@7307

instantsearch.css

npm i https://pkg.pr.new/algolia/instantsearch/instantsearch.css@7307

instantsearch.js

npm i https://pkg.pr.new/algolia/instantsearch/instantsearch.js@7307

react-instantsearch

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch@7307

react-instantsearch-core

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch-core@7307

react-instantsearch-nextjs

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch-nextjs@7307

react-instantsearch-router-nextjs

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch-router-nextjs@7307

vue-instantsearch

npm i https://pkg.pr.new/algolia/instantsearch/vue-instantsearch@7307

commit: 6a0add1

@github-actions

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 1.04 MB

ℹ️ View Unchanged
Filename Size Change
packages/algoliasearch-helper/dist/algoliasearch.helper.js 44.5 kB 0 B
packages/algoliasearch-helper/dist/algoliasearch.helper.min.js 14.1 kB -1 B (-0.01%)
packages/instantsearch.css/components/ai-mode-button.css 1.76 kB 0 B
packages/instantsearch.css/components/autocomplete-min.css 4.33 kB 0 B
packages/instantsearch.css/components/autocomplete.css 4.68 kB 0 B
packages/instantsearch.css/components/button.css 1.98 kB 0 B
packages/instantsearch.css/components/chat-min.css 7.4 kB 0 B
packages/instantsearch.css/components/chat.css 7.91 kB 0 B
packages/instantsearch.css/components/filter-suggestions.css 1.89 kB 0 B
packages/instantsearch.css/themes/algolia-min.css 11.9 kB 0 B
packages/instantsearch.css/themes/algolia.css 12.6 kB 0 B
packages/instantsearch.css/themes/nova-min.css 12 kB 0 B
packages/instantsearch.css/themes/nova.css 12.8 kB 0 B
packages/instantsearch.css/themes/reset-min.css 1.3 kB 0 B
packages/instantsearch.css/themes/reset.css 1.38 kB 0 B
packages/instantsearch.css/themes/satellite-min.css 12.8 kB 0 B
packages/instantsearch.css/themes/satellite.css 13.7 kB 0 B
packages/instantsearch.js/dist/instantsearch.development.js 334 kB 0 B
packages/instantsearch.js/dist/instantsearch.production.min.js 152 kB 0 B
packages/react-instantsearch-core/dist/umd/ReactInstantSearchCore.min.js 73.8 kB -1 B (0%)
packages/react-instantsearch/dist/umd/ReactInstantSearch.min.js 125 kB 0 B
packages/vue-instantsearch/vue2/cjs/index.js 19.9 kB 0 B
packages/vue-instantsearch/vue2/umd/index.js 74.3 kB -4 B (-0.01%)
packages/vue-instantsearch/vue3/cjs/index.js 20.6 kB 0 B
packages/vue-instantsearch/vue3/umd/index.js 74.7 kB -6 B (-0.01%)

compressed-size-action

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant