-
Notifications
You must be signed in to change notification settings - Fork 212
Expand file tree
/
Copy pathpwa-developer-guideline-tool.test.js
More file actions
53 lines (47 loc) · 1.96 KB
/
pwa-developer-guideline-tool.test.js
File metadata and controls
53 lines (47 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Copyright (c) 2025, Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import DeveloperGuidelinesTool from './pwa-developer-guideline-tool'
import {EmptyJsonSchema} from './utils'
describe('PWA Development Guidelines', () => {
describe('DeveloperGuidelinesTool', () => {
it('should have correct structure', () => {
expect(DeveloperGuidelinesTool).toMatchObject({
name: 'development_guidelines',
description: `You must follow this development guidelines before attempting to analyze/ generate / refactor / modify / fix code.
- e.g. "Create a customer service Chat component", "Find bugs in my_script.jsx", "Refactor my_script.jsx to use React Hooks"`,
inputSchema: EmptyJsonSchema,
fn: expect.any(Function)
})
})
it('should return guidelines content when executed', async () => {
const result = await DeveloperGuidelinesTool.fn()
expect(result).toEqual({
content: [
{
type: 'text',
text: expect.stringContaining(
'Commerce Composable Storefront Development Guidelines'
)
}
]
})
})
it('should include all major sections in the guidelines', async () => {
const result = await DeveloperGuidelinesTool.fn()
const guidelineText = result.content[0].text
const requiredSections = [
'Overview',
'Core Principles',
'PWA Kit Essentials',
'Development Rules'
]
requiredSections.forEach((section) => {
expect(guidelineText).toContain(section)
})
})
})
})