Skip to content

Commit 547530e

Browse files
authored
merged Torino
2 parents c2c5e4a + 2c67827 commit 547530e

36 files changed

+5676
-9073
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
.localdevserver
77
node_modules
88
coverage
9-
/.idea/
9+
/.idea/codeStyles/
10+
/.idea/.gitignore
11+
/.idea/inspectionProfiles/

.idea/illuminatedCloud.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/sfdc-ui-lookup-lwc.iml

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 58 additions & 21 deletions
Large diffs are not rendered by default.

codecov.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
flags:
6+
- LWC
7+
- Apex
8+
LWC:
9+
flags:
10+
- LWC
11+
Apex:
12+
flags:
13+
- Apex
14+
patch: off
115
ignore:
216
- 'src-sample/**'

config/project-scratch-def.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"orgName": "pozil",
3-
"edition": "Developer",
3+
"edition": "Partner Developer",
44
"language": "en_US",
55
"hasSampleData": true,
66
"settings": {
@@ -9,6 +9,9 @@
99
},
1010
"mobileSettings": {
1111
"enableS1EncryptedStoragePref2": false
12+
},
13+
"chatterSettings": {
14+
"enableChatter": true
1215
}
1316
}
1417
}

jest-mocks/lightning/navigation.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* For the original lightning/navigation mock that comes by default with
3+
* @salesforce/sfdx-lwc-jest, see:
4+
* https://github.com/salesforce/sfdx-lwc-jest/blob/master/src/lightning-stubs/navigation/navigation.js
5+
*/
6+
export const CurrentPageReference = jest.fn();
7+
8+
let _navigatePageReference, _generatePageReference, _replace;
9+
10+
const Navigate = Symbol('Navigate');
11+
const GenerateUrl = Symbol('GenerateUrl');
12+
export const NavigationMixin = (Base) => {
13+
return class extends Base {
14+
[Navigate](pageReference, replace) {
15+
_navigatePageReference = pageReference;
16+
_replace = replace;
17+
}
18+
[GenerateUrl](pageReference) {
19+
_generatePageReference = pageReference;
20+
return new Promise((resolve) => resolve('https://www.example.com'));
21+
}
22+
};
23+
};
24+
NavigationMixin.Navigate = Navigate;
25+
NavigationMixin.GenerateUrl = GenerateUrl;
26+
27+
/*
28+
* Tests do not have access to the internals of this mixin used by the
29+
* component under test so save a reference to the arguments the Navigate method is
30+
* invoked with and provide access with this function.
31+
*/
32+
export const getNavigateCalledWith = () => {
33+
return {
34+
pageReference: _navigatePageReference,
35+
replace: _replace
36+
};
37+
};
38+
39+
export const getGenerateUrlCalledWith = () => ({
40+
pageReference: _generatePageReference
41+
});

jest.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
const { jestConfig } = require('@salesforce/sfdx-lwc-jest/config');
22
module.exports = {
3-
...jestConfig
3+
...jestConfig,
4+
moduleNameMapper: {
5+
'^lightning/navigation$': '<rootDir>/jest-mocks/lightning/navigation',
6+
'^c/resourceIcon$':
7+
'<rootDir>/submodules/up2go-clean/sfdx-source/up2go-clean/main/default/lwc/resourceIcon/resourceIcon'
8+
},
9+
testMatch: ['**/__tests__/**/*.test.js']
410
};

0 commit comments

Comments
 (0)