Skip to content

Commit 3b25035

Browse files
feat: update labels to support regex
1 parent 05ff91a commit 3b25035

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

packages/template-retail-react-app/app/components/search/partials/ask-assistant-banner.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('renders Ask Shopping Agent banner with title and description', () => {
2525

2626
expect(
2727
screen.getByRole('button', {
28-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
28+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
2929
})
3030
).toBeInTheDocument()
3131
expect(screen.getByText((content) => content === 'Ask Shopping Agent')).toBeInTheDocument()
@@ -41,7 +41,7 @@ test('calls onClick when banner is clicked', async () => {
4141
renderWithProviders(<AskAssistantBanner onClick={onClick} styles={baseStyles} />)
4242

4343
const button = screen.getByRole('button', {
44-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
44+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
4545
})
4646
await user.click(button)
4747

packages/template-retail-react-app/app/components/search/partials/search-suggestions-section.test.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ describe('Ask Shopping Agent banner', () => {
162162
)
163163

164164
const banners = screen.getAllByRole('button', {
165-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
165+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
166166
})
167167
expect(banners.length).toBeGreaterThanOrEqual(1)
168168
})
@@ -184,7 +184,7 @@ describe('Ask Shopping Agent banner', () => {
184184

185185
expect(
186186
screen.queryByRole('button', {
187-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
187+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
188188
})
189189
).not.toBeInTheDocument()
190190
})
@@ -205,7 +205,7 @@ describe('Ask Shopping Agent banner', () => {
205205

206206
expect(
207207
screen.queryByRole('button', {
208-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
208+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
209209
})
210210
).not.toBeInTheDocument()
211211
})
@@ -228,7 +228,7 @@ describe('Ask Shopping Agent banner', () => {
228228
)
229229

230230
const banner = screen.getAllByRole('button', {
231-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
231+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
232232
})[0]
233233
await user.click(banner)
234234

packages/template-retail-react-app/app/components/search/partials/search-suggestions.test.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ test('when no suggestions: renders RecentSearches and shows Ask Shopping Agent b
4646
expect(screen.getByTestId('sf-suggestion-recent')).toBeInTheDocument()
4747
expect(
4848
screen.getByRole('button', {
49-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
49+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
5050
})
5151
).toBeInTheDocument()
5252
})
@@ -65,7 +65,7 @@ test('when no suggestions and enableAgentFromSearchSuggestions false: does not s
6565
expect(screen.getByTestId('sf-suggestion-recent')).toBeInTheDocument()
6666
expect(
6767
screen.queryByRole('button', {
68-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
68+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
6969
})
7070
).not.toBeInTheDocument()
7171
})
@@ -82,7 +82,7 @@ test('when no suggestions and onAskAssistantClick not provided: does not show As
8282

8383
expect(
8484
screen.queryByRole('button', {
85-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
85+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
8686
})
8787
).not.toBeInTheDocument()
8888
})
@@ -100,7 +100,7 @@ test('enableAgentFromSearchSuggestions string "true" shows banner when no sugges
100100

101101
expect(
102102
screen.getByRole('button', {
103-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
103+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
104104
})
105105
).toBeInTheDocument()
106106
})
@@ -121,7 +121,7 @@ test('when has suggestions: renders SuggestionSection with showAskAssistantBanne
121121

122122
expect(screen.getByTestId('suggestion-section')).toBeInTheDocument()
123123
const banner = screen.getByRole('button', {
124-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
124+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
125125
})
126126
expect(banner).toBeInTheDocument()
127127
})
@@ -142,7 +142,7 @@ test('when has suggestions and banner enabled: clicking banner calls onAskAssist
142142
)
143143

144144
const banner = screen.getByRole('button', {
145-
name: /Ask Shopping Agent.*discover, compare and shop smarter/i
145+
name: /Ask Shopping Agent.*discover, compare,? and shop smarter/i
146146
})
147147
await user.click(banner)
148148
expect(onAskAssistantClick).toHaveBeenCalledTimes(1)

0 commit comments

Comments
 (0)