Skip to content

Commit e7b3481

Browse files
authored
Merge pull request #2778 from SalesforceCommerceCloud/sz-W-19007043-comment-attribution
@W-19007043 - remove AI attribution comments PR 2
2 parents 059b832 + a5bd30e commit e7b3481

File tree

4 files changed

+0
-92
lines changed

4 files changed

+0
-92
lines changed

.cursor/rules/testing/unit-tests-generic.mdc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,6 @@ USE WHEN writing unit tests for components in template packages
77

88
# 🧪 Generic Component Test Rules
99

10-
# CRITICAL: AI Attribution Requirements
11-
* **IMPORTANT** All individual test methods generated or modified by Cursor MUST include an AI attribution comment directly above the test stating the following:
12-
"DO NOT REMOVE THIS COMMENT! This test was generated by Cursor". The comment should go on the test method and not the test class. Failure to add an AI Attribution Comment will be considered a failure of test generation.
13-
* The AI attribution comment MUST include a comment declaring the LLM model that was used in writing the test on its own line.
14-
15-
*Sample AI Attribution Comment*
16-
```
17-
/*
18-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
19-
* This test was generated with the following model: Claude 3.5 Sonnet
20-
*/
21-
test('renders component correctly', () => {
22-
// test implementation
23-
})
24-
```
25-
2610
## Structure & Best Practices
2711
- Use `describe` blocks to group tests, `test` for individual cases
2812
- Use `beforeEach` for setup, clear mocks after each test

packages/pwa-storefront-mcp/src/utils/utils.test.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,11 @@ describe('Utils', () => {
3131
})
3232

3333
describe('isMonoRepo', () => {
34-
/*
35-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
36-
* This test was generated with the following model: GPT-4.1
37-
*/
3834
test('returns true if lerna.json exists', () => {
3935
jest.spyOn(fs, 'existsSync').mockReturnValueOnce(true)
4036
expect(isMonoRepo()).toBe(true)
4137
})
4238

43-
/*
44-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
45-
* This test was generated with the following model: GPT-4.1
46-
*/
4739
test('returns false if lerna.json does not exist', () => {
4840
jest.spyOn(fs, 'existsSync').mockReturnValueOnce(false)
4941
expect(isMonoRepo()).toBe(false)

packages/template-retail-react-app/app/components/drawer-menu/drawer-menu.test.js

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ describe('DrawerMenu', () => {
7373
expect(spinner).toBeInTheDocument()
7474
})
7575

76-
/*
77-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
78-
* This test was generated with the following model: Claude Sonnet 4
79-
*/
8076
test('renders drawer in closed state', () => {
8177
renderWithProviders(<DrawerMenu isOpen={false} root={mockCategories.root} />)
8278

@@ -85,10 +81,6 @@ describe('DrawerMenu', () => {
8581
expect(drawerContent).not.toBeInTheDocument()
8682
})
8783

88-
/*
89-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
90-
* This test was generated with the following model: Claude Sonnet 4
91-
*/
9284
test('calls onClose when close button is clicked', async () => {
9385
const {user} = renderWithProviders(
9486
<DrawerMenu isOpen={true} root={mockCategories.root} onClose={mockOnClose} />
@@ -100,10 +92,6 @@ describe('DrawerMenu', () => {
10092
expect(mockOnClose).toHaveBeenCalledTimes(1)
10193
})
10294

103-
/*
104-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
105-
* This test was generated with the following model: Claude Sonnet 4
106-
*/
10795
test('calls onLogoClick when logo is clicked', async () => {
10896
const {user} = renderWithProviders(
10997
<DrawerMenu isOpen={true} root={mockCategories.root} onLogoClick={mockOnLogoClick} />
@@ -116,10 +104,6 @@ describe('DrawerMenu', () => {
116104
expect(mockOnLogoClick).toHaveBeenCalledTimes(1)
117105
})
118106

119-
/*
120-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
121-
* This test was generated with the following model: Claude Sonnet 4
122-
*/
123107
test('displays sign in link for guest users', () => {
124108
useCustomerType.mockReturnValue({isRegistered: false})
125109

@@ -132,10 +116,6 @@ describe('DrawerMenu', () => {
132116
expect(signInLink).toHaveClass('chakra-link')
133117
})
134118

135-
/*
136-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
137-
* This test was generated with the following model: Claude Sonnet 4
138-
*/
139119
test('displays user account menu for registered users', () => {
140120
useCustomerType.mockReturnValue({isRegistered: true})
141121

@@ -145,10 +125,6 @@ describe('DrawerMenu', () => {
145125
expect(myAccountButton).toBeInTheDocument()
146126
})
147127

148-
/*
149-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
150-
* This test was generated with the following model: Claude Sonnet 4
151-
*/
152128
test('expands user account menu and shows account options', async () => {
153129
useCustomerType.mockReturnValue({isRegistered: true})
154130

@@ -164,10 +140,6 @@ describe('DrawerMenu', () => {
164140
})
165141
})
166142

167-
/*
168-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
169-
* This test was generated with the following model: Claude Sonnet 4
170-
*/
171143
test('handles logout action for registered users', async () => {
172144
useCustomerType.mockReturnValue({isRegistered: true})
173145

@@ -187,10 +159,6 @@ describe('DrawerMenu', () => {
187159
})
188160
})
189161

190-
/*
191-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
192-
* This test was generated with the following model: Claude Sonnet 4
193-
*/
194162
test('renders category navigation when root categories are provided', () => {
195163
renderWithProviders(<DrawerMenu isOpen={true} root={mockCategories.root} />)
196164

@@ -201,10 +169,6 @@ describe('DrawerMenu', () => {
201169
expect(categoryNav).toHaveAttribute('aria-atomic', 'true')
202170
})
203171

204-
/*
205-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
206-
* This test was generated with the following model: Claude Sonnet 4
207-
*/
208172
test('renders with custom itemsKey and itemsCountKey props', () => {
209173
const customRoot = {
210174
customItems: [{id: 'test-item', name: 'Test Item', customItems: []}]

packages/template-retail-react-app/app/components/header/index.test.js

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -227,29 +227,17 @@ test('shows dropdown menu when an authenticated users hover on the account icon'
227227
})
228228
})
229229

230-
/*
231-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
232-
* This test was generated with the following model: Claude 3.5 Sonnet
233-
*/
234230
test('handles sign out functionality correctly', async () => {
235231
// Skip this complex test - focus on simpler testable behaviors
236232
expect(true).toBe(true)
237233
})
238234

239-
/*
240-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
241-
* This test was generated with the following model: Claude 3.5 Sonnet
242-
*/
243235
test('shows loading spinner during sign out process', async () => {
244236
// Skip this test as it requires complex auth setup
245237
// Focus on testing the loading state logic separately
246238
expect(true).toBe(true)
247239
})
248240

249-
/*
250-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
251-
* This test was generated with the following model: Claude 3.5 Sonnet
252-
*/
253241
test('handles keyboard navigation with Tab+Shift in account menu', async () => {
254242
// Test keyboard navigation without requiring auth
255243
const {user} = renderWithProviders(<Header />)
@@ -261,10 +249,6 @@ test('handles keyboard navigation with Tab+Shift in account menu', async () => {
261249
expect(accountIcon).toBeInTheDocument()
262250
})
263251

264-
/*
265-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
266-
* This test was generated with the following model: Claude 3.5 Sonnet
267-
*/
268252
test('handles mouse leave events without crashing', async () => {
269253
const {user} = renderWithProviders(<Header />)
270254

@@ -277,10 +261,6 @@ test('handles mouse leave events without crashing', async () => {
277261
expect(accountIcon).toBeInTheDocument()
278262
})
279263

280-
/*
281-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
282-
* This test was generated with the following model: Claude 3.5 Sonnet
283-
*/
284264
test('renders with various props correctly', async () => {
285265
const mockHandlers = {
286266
onMenuClick: jest.fn(),
@@ -301,10 +281,6 @@ test('renders with various props correctly', async () => {
301281
expect(screen.getByLabelText(/My cart/)).toBeInTheDocument()
302282
})
303283

304-
/*
305-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
306-
* This test was generated with the following model: Claude 3.5 Sonnet
307-
*/
308284
test('handles responsive behavior correctly', async () => {
309285
// Test desktop behavior
310286
useMediaQuery.mockReturnValue([true]) // isDesktop = true
@@ -323,10 +299,6 @@ test('handles responsive behavior correctly', async () => {
323299
expect(screen.getByLabelText('My Account')).toBeInTheDocument()
324300
})
325301

326-
/*
327-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
328-
* This test was generated with the following model: Claude 3.5 Sonnet
329-
*/
330302
test('renders children in body container', async () => {
331303
const testContent = 'Test Children Content'
332304

@@ -342,10 +314,6 @@ test('renders children in body container', async () => {
342314
})
343315
})
344316

345-
/*
346-
* DO NOT REMOVE THIS COMMENT! This test was generated by Cursor
347-
* This test was generated with the following model: Claude 3.5 Sonnet
348-
*/
349317
test('handles search functionality', async () => {
350318
renderWithProviders(<Header />)
351319

0 commit comments

Comments
 (0)