Skip to content

Commit 2d56308

Browse files
ervingayleAdam-it
andauthored
Spfx 1.20 and React Testing Library implement (#1459)
* Spfx 1.20 and React Testing Library implement * Disable debug mode Disable debug mode for production usage * fixup --------- Co-authored-by: Adam Wójcik <[email protected]>
1 parent 0b6c614 commit 2d56308

25 files changed

+33282
-23886
lines changed

samples/react-mega-menu/.eslintrc.js

Lines changed: 352 additions & 0 deletions
Large diffs are not rendered by default.

samples/react-mega-menu/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ obj
3131

3232
# Styles Generated Code
3333
*.scss.ts
34+
35+
# Heft Folder
36+
.heft

samples/react-mega-menu/.npmignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
!dist
2+
config
3+
4+
gulpfile.js
5+
6+
release
7+
src
8+
temp
9+
10+
tsconfig.json
11+
tslint.json
12+
13+
*.log
14+
15+
.yo-rc.json
16+
.vscode
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
22
"@microsoft/generator-sharepoint": {
3-
"version": "1.12.1",
3+
"version": "1.20.0",
44
"libraryName": "react-mega-menu",
55
"libraryId": "466eb049-ab57-4a5d-ae51-0a8221cdb984",
66
"environment": "spo",
7+
"nodeVersion": "18.18.0",
78
"isCreatingSolution": true,
89
"packageManager": "npm",
910
"componentType": "webpart",
10-
"isDomainIsolated": false
11+
"isDomainIsolated": false,
12+
"sdkVersions": {
13+
"@microsoft/microsoft-graph-client": "3.0.2"
14+
}
1115
}
1216
}

samples/react-mega-menu/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Since SharePoint list is used to store the menu items is relatively easy to chan
8282
Solution|Author(s)
8383
--------|---------
8484
react-mega-menu | Velin Georgiev ([@VelinGeorgiev](https://twitter.com/velingeorgiev))
85+
SPFx v1.20 and React Testling Library | Ervin Gayle(https://github.com/ervingayle)
8586

8687
## Version history
8788

@@ -92,6 +93,7 @@ Version|Date|Comments
9293
0.1.1|October 10, 2018 | Updated to SPFx 1.6.0 and @pnp 1.2.2
9394
0.1.2|December 10, 2018 | Updated to SPFx 1.7.0 and @pnp 1.2.7
9495
0.1.3|October 28, 2022 | Upgrade to SPFx 1.12.1
96+
0.1.4|Decemberr 30, 2024 | Upgrade to SPFx 1.20.0 and React Testing Library from Enzyme
9597

9698

9799
## Disclaimer
@@ -114,6 +116,7 @@ Full URL to request would be something like following:
114116
https://tenant.sharepoint.com/Shared%20Documents/Forms/AllItems.aspx?debugManifestsFile=https://localhost:4321/temp/manifests.js&loadSPFX=true&customActions={%226a4a81ba-4704-463b-98eb-1d1bfa710744%22:{%22location%22:%22ClientSideExtension.ApplicationCustomizer%22,%22properties%22:{%22isDebug%22:true,%22rootWebOnly%22:false,%22enableSessionStorageCache%22:true}}}
115117
```
116118
- Select `Load debug scripts` on the **Allow debug scripts?** popup window.
119+
- To run unit tests `npx jest` or `npx jest --verbose`
117120

118121
## Features
119122

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import jest from 'jest-mock';
2+
3+
export const Log = { info: jest.fn(), error: jest.fn(), warn: jest.fn(), };

samples/react-mega-menu/assets/sample.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"This sample shows site mega menu. Application customizer is used along with SharePoint List to store the menu items."
1010
],
1111
"creationDateTime": "2018-12-10",
12-
"updateDateTime": "2018-12-10",
12+
"updateDateTime": "2024-10-31",
1313
"products": [
1414
"SharePoint"
1515
],
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
"key": "SPFX-VERSION",
23-
"value": "1.7.0"
23+
"value": "1.20.0"
2424
}
2525
],
2626
"tags": [],
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
presets: [
3+
['@babel/preset-env', { targets: { node: 'current' } }],
4+
['@babel/preset-react', { runtime: 'automatic' }],
5+
['@babel/preset-typescript', { allowNamespaces: true }]
6+
]
7+
};

samples/react-mega-menu/config/copy-assets.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

samples/react-mega-menu/config/package-solution.json

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"solution": {
44
"name": "react-mega-menu-client-side-solution",
55
"id": "466eb049-ab57-4a5d-ae51-0a8221cdb984",
6-
"version": "0.1.3",
6+
"version": "0.1.4.0",
77
"includeClientSideAssets": true,
88
"isDomainIsolated": false,
99
"features": [
1010
{
1111
"title": "Application Extension - Deployment of custom action.",
1212
"description": "Deploys a custom action with ClientSideComponentId association",
1313
"id": "0582bd9b-5570-4698-8ac8-a2aee2801bad",
14-
"version": "0.1.0",
14+
"version": "0.1.4.0",
1515
"assets": {
1616
"elementManifests": [
1717
"elements.xml"
@@ -21,7 +21,25 @@
2121
]
2222
}
2323
}
24-
]
24+
],
25+
"developer": {
26+
"name": "",
27+
"privacyUrl": "",
28+
"termsOfUseUrl": "",
29+
"websiteUrl": "",
30+
"mpnId": "Undefined-1.15.0"
31+
},
32+
"metadata": {
33+
"shortDescription": {
34+
"default": "react-mega-menu description"
35+
},
36+
"longDescription": {
37+
"default": "react-mega-menu description"
38+
},
39+
"screenshotPaths": [],
40+
"videoUrl": "",
41+
"categories": []
42+
}
2543
},
2644
"paths": {
2745
"zippedPackage": "solution/react-mega-menu.sppkg"

0 commit comments

Comments
 (0)