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

fix(retail-react-app): recent searches #969

Merged

Conversation

breadadams
Copy link
Contributor

Description

Closes #968

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • Add missing return to recent searches filter method

How to Test-Drive This PR

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

+ Add missing `return` to recent searches filter method
+ Add test cases for recent search storage
@breadadams breadadams requested a review from a team as a code owner February 8, 2023 00:54
Comment on lines -33 to -40
test('renders Popover if recent searches populated', async () => {
renderWithProviders(<SearchInput />)
const searchInput = document.querySelector('input[type="search"]')
await user.type(searchInput, 'Dresses')
expect(await screen.findByTestId('sf-suggestion')).toBeInTheDocument()
const countOfSuggestions = await screen.findAllByText('Dresses')
expect(countOfSuggestions.length).toEqual(2)
})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed this test as it seems it's sort of a duplicate of "shows previously searched items when focused" (L45).

@vmarta
Copy link
Contributor

vmarta commented Feb 9, 2023

@breadadams thank you for fixing it and writing the tests too 🙏

@vmarta vmarta merged commit aa48ea8 into SalesforceCommerceCloud:develop Feb 9, 2023
bfeister added a commit that referenced this pull request Feb 16, 2023
* develop: (52 commits)
  fix localstorage key by add siteId prefix (#988)
  [Shopper Experience] `ImageTile` component (#967)
  Skip Snyk CLI (#983)
  fix(retail-react-app): recent searches (#969)
  [Feature] Shopper Experience / Page Designer Components (#963)
  fix(template-retail-react-app): improved handling of blocked einstein requests (#970)
  remove getResetPasswordToken from not implemented list (#973)
  Apply changes from commerce react sdk in feature branch (#964)
  Add Shopper Experience hooks (#958)
  chore: update pwa-kit-dev eslint config (#950)
  Serialize category data once only (#953)
  Fix layout shift for mega menu (#952)
  Update customer baskets cache when there is a basket mutation (#945)
  Remove the PersistentCache functionality (#949)
  Replace isomorphic jest mocks with msw handlers (#944)
  fix: handle special characters in `boldString` util (#942)
  Fix broken CI – confusing path to package.json in the 'dist' directory! (#946)
  @W-11920099 Re-write 'npm push' in Typescript, warn if Node deprecated (#763)
  Allow support for multiple sites concurrently w/ `commerce-sdk-react` (#911)
  Update `develop` with v2.6.0 (#939)
  ...

# Conflicts:
#	lerna.json
#	package-lock.json
#	package.json
#	packages/commerce-sdk-react/CHANGELOG.md
#	packages/commerce-sdk-react/package-lock.json
#	packages/commerce-sdk-react/package.json
#	packages/internal-lib-build/package-lock.json
#	packages/internal-lib-build/package.json
#	packages/pwa-kit-create-app/package-lock.json
#	packages/pwa-kit-create-app/package.json
#	packages/pwa-kit-dev/CHANGELOG.md
#	packages/pwa-kit-dev/bin/pwa-kit-dev.js
#	packages/pwa-kit-dev/package-lock.json
#	packages/pwa-kit-dev/package.json
#	packages/pwa-kit-react-sdk/CHANGELOG.md
#	packages/pwa-kit-react-sdk/package-lock.json
#	packages/pwa-kit-react-sdk/package.json
#	packages/pwa-kit-react-sdk/src/ssr/browser/main.jsx
#	packages/pwa-kit-runtime/CHANGELOG.md
#	packages/pwa-kit-runtime/package-lock.json
#	packages/pwa-kit-runtime/package.json
#	packages/template-express-minimal/package-lock.json
#	packages/template-express-minimal/package.json
#	packages/template-retail-react-app/app/commerce-api/mock-data.js
#	packages/template-retail-react-app/package-lock.json
#	packages/template-retail-react-app/package.json
#	packages/template-typescript-minimal/package-lock.json
#	packages/template-typescript-minimal/package.json
#	packages/test-commerce-sdk-react/package-lock.json
#	packages/test-commerce-sdk-react/package.json
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.

[BUG] retail-react-app: only one recent search being stored
4 participants