diff --git a/.circleci/config.yml b/.circleci/config.yml index cea0053c0..90cf8371f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,29 +52,32 @@ workflows: - linux - windows node_version: - - latest + # - latest - lts - maintenance exclude: - - os: windows - node_version: lts - os: windows node_version: maintenance - release-management/test-nut: - name: nuts-on-linux - node_version: lts - size: large - sfdx_version: latest - requires: - - release-management/test-package - - release-management/test-nut: - name: nuts-on-windows sfdx_version: latest - size: large node_version: lts - os: windows + size: large requires: - release-management/test-package + matrix: + parameters: + os: + - linux + - windows + command: + - 'yarn test:nuts:convert' + - 'yarn test:nuts:delete' + - 'yarn test:nuts:deploy' + - 'yarn test:nuts:manifest:create' + - 'yarn test:nuts:retrieve' + - 'yarn test:nuts:specialTypes' + - 'yarn test:nuts:deploy:destructive' + - 'yarn test:nuts:tracking' - release-management/release-package: sign: true github-release: true diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 86a61a965..5f4328736 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,3 +3,4 @@ # @forcedotcom/pdt will be requested for # review when someone opens a pull request. * @forcedotcom/pdt +#ECCN:Open Source \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 87216c5a0..6deadfe29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [1.2.6](https://github.com/salesforcecli/plugin-source/compare/v1.2.5...v1.2.6) (2021-10-21) + +### Bug Fixes + +- use cross-env for test:nuts script ([#260](https://github.com/salesforcecli/plugin-source/issues/260)) ([76627fb](https://github.com/salesforcecli/plugin-source/commit/76627fb21c62a4fb140c87ccfc266accd79af3fd)) + +### [1.2.5](https://github.com/salesforcecli/plugin-source/compare/v1.2.4...v1.2.5) (2021-10-21) + +### [1.2.4](https://github.com/salesforcecli/plugin-source/compare/v1.2.3...v1.2.4) (2021-10-12) + +### [1.2.3](https://github.com/salesforcecli/plugin-source/compare/v1.2.1...v1.2.3) (2021-10-11) + +### Bug Fixes + +- add back missing long parameter descriptions for some force:source commands ([#241](https://github.com/salesforcecli/plugin-source/issues/241)) ([d87671b](https://github.com/salesforcecli/plugin-source/commit/d87671b4987317d395873d6ef382e6a3ca2080e5)) +- remote-only deletes now supported ([#220](https://github.com/salesforcecli/plugin-source/issues/220)) ([fed3ff4](https://github.com/salesforcecli/plugin-source/commit/fed3ff496e732c6b960ae5838ea302e6b51e9029)) + ### [1.2.1](https://github.com/salesforcecli/plugin-source/compare/v1.2.0...v1.2.1) (2021-10-05) ### Bug Fixes diff --git a/README.md b/README.md index 988ecdb71..7e39174df 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ $ npm install -g @salesforce/plugin-source $ sfdx COMMAND running command... $ sfdx (-v|--version|version) -@salesforce/plugin-source/1.2.0 linux-x64 node-v12.22.6 +@salesforce/plugin-source/1.2.5 linux-x64 node-v12.22.7 $ sfdx --help [COMMAND] USAGE $ sfdx COMMAND @@ -96,7 +96,7 @@ USAGE - [`sfdx force:source:convert [-r ] [-d ] [-n ] [-p | -x | -m ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourceconvert--r-directory--d-directory--n-string--p-array---x-string---m-array---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) - [`sfdx `](#sfdx-) -- [`sfdx force:source:deploy [--soapdeploy] [-w ] [-q | -x | -m | -p | -c | -l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r | -o | -g] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeploy---soapdeploy--w-minutes--q-id---x-filepath---m-array---p-array---c---l-notestrunrunspecifiedtestsrunlocaltestsrunalltestsinorg---r-array---o---g--u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) +- [`sfdx force:source:deploy [--soapdeploy] [-w ] [-q | -x | -m | -p | -c | -l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r | -o | -g] [--predestructivechanges ] [--postdestructivechanges ] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeploy---soapdeploy--w-minutes--q-id---x-filepath---m-array---p-array---c---l-notestrunrunspecifiedtestsrunlocaltestsrunalltestsinorg---r-array---o---g---predestructivechanges-filepath----postdestructivechanges-filepath---u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) - [`sfdx force:source:deploy:cancel [-w ] [-i ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeploycancel--w-minutes--i-id--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) - [`sfdx force:source:deploy:report [-w ] [-i ] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeployreport--w-minutes--i-id--u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) - [`sfdx force:source:manifest:create [-m | -p ] [-n | -t pre|post|destroy|package] [-o ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcemanifestcreate--m-array---p-array--n-string---t-prepostdestroypackage--o-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) @@ -123,7 +123,7 @@ USAGE OPTIONS -d, --outputdir=outputdir [default: - metadataPackage_1633397509876] + metadataPackage_1634849032196] output directory to store the Metadata API–formatted files in @@ -161,7 +161,7 @@ EXAMPLES $ sfdx force:source:convert -r path/to/source -d path/to/outputdir -n 'My Package' ``` -_See code: [src/commands/force/source/convert.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.0/src/commands/force/source/convert.ts)_ +_See code: [src/commands/force/source/convert.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.5/src/commands/force/source/convert.ts)_ ## `sfdx ` @@ -217,9 +217,9 @@ EXAMPLES $ sfdx force:source:delete -p path/to/source ``` -_See code: [src/commands/force/source/delete.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.0/src/commands/force/source/delete.ts)_ +_See code: [src/commands/force/source/delete.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.5/src/commands/force/source/delete.ts)_ -## `sfdx force:source:deploy [--soapdeploy] [-w ] [-q | -x | -m | -p | -c | -l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r | -o | -g] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` +## `sfdx force:source:deploy [--soapdeploy] [-w ] [-q | -x | -m | -p | -c | -l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r | -o | -g] [--predestructivechanges ] [--postdestructivechanges ] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` deploy source to an org @@ -235,12 +235,13 @@ To run the command asynchronously, set --wait to 0, which immediately returns th To check the status of the job, use force:source:deploy:report. If the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes. On Windows, if the list contains commas, also enclose the entire list in one set of double quotes. - + If you use the --manifest, --predestructivechanges, or --postdestructivechanges parameters, run the force:source:manifest:create command to easily generate the different types of manifest files. USAGE $ sfdx force:source:deploy [--soapdeploy] [-w ] [-q | -x | -m | -p | -c | -l - NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r | -o | -g] [-u ] [--apiversion - ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] + NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r | -o | -g] [--predestructivechanges + ] [--postdestructivechanges ] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel + trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS -c, --checkonly validate deploy but don’t save to @@ -284,6 +285,16 @@ OPTIONS --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for this command invocation + --postdestructivechanges=postdestructivechanges file path for a manifest + (destructiveChangesPost.xml) of + components to delete after the + deploy + + --predestructivechanges=predestructivechanges file path for a manifest + (destructiveChangesPre.xml) of + components to delete before the + deploy + --soapdeploy deploy metadata with SOAP API instead of REST API @@ -303,6 +314,8 @@ DESCRIPTION If the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes. On Windows, if the list contains commas, also enclose the entire list in one set of double quotes. + If you use the --manifest, --predestructivechanges, or --postdestructivechanges parameters, run the + force:source:manifest:create command to easily generate the different types of manifest files. EXAMPLES To deploy the source files in a directory: @@ -326,10 +339,14 @@ EXAMPLES To check whether a deployment would succeed (to prepare for Quick Deploy): $ sfdx force:source:deploy -m ApexClass -l RunAllTestsInOrg -c To deploy an already validated deployment (Quick Deploy): - $ sfdx force:source:deploy -q 0Af9A00000FTM6pSAH`, + $ sfdx force:source:deploy -q 0Af9A00000FTM6pSAH` + To run a destructive operation before the deploy occurs: + $ sfdx force:source:deploy --manifest package.xml --predestructivechanges destructiveChangesPre.xml + To run a destructive operation after the deploy occurs: + $ sfdx force:source:deploy --manifest package.xml --postdestructivechanges destructiveChangesPost.xml ``` -_See code: [src/commands/force/source/deploy.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.0/src/commands/force/source/deploy.ts)_ +_See code: [src/commands/force/source/deploy.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.5/src/commands/force/source/deploy.ts)_ ## `sfdx force:source:deploy:cancel [-w ] [-i ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` @@ -384,7 +401,7 @@ EXAMPLES $ sfdx force:source:deploy:report ``` -_See code: [src/commands/force/source/deploy/cancel.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.0/src/commands/force/source/deploy/cancel.ts)_ +_See code: [src/commands/force/source/deploy/cancel.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.5/src/commands/force/source/deploy/cancel.ts)_ ## `sfdx force:source:deploy:report [-w ] [-i ] [-u ] [--apiversion ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` @@ -434,7 +451,7 @@ EXAMPLES $ sfdx force:source:deploy:report ``` -_See code: [src/commands/force/source/deploy/report.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.0/src/commands/force/source/deploy/report.ts)_ +_See code: [src/commands/force/source/deploy/report.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.5/src/commands/force/source/deploy/report.ts)_ ## `sfdx force:source:manifest:create [-m | -p ] [-n | -t pre|post|destroy|package] [-o ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` @@ -513,7 +530,7 @@ EXAMPLES $ sfdx force:source:manifest:create --sourcepath force-app --manifestname myNewManifest ``` -_See code: [src/commands/force/source/manifest/create.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.0/src/commands/force/source/manifest/create.ts)_ +_See code: [src/commands/force/source/manifest/create.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.5/src/commands/force/source/manifest/create.ts)_ ## `sfdx force:source:open -f [-r] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` @@ -563,7 +580,7 @@ EXAMPLES $ sfdx force:source:open -f path/to/source -u my-user@my-org.com ``` -_See code: [src/commands/force/source/open.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.0/src/commands/force/source/open.ts)_ +_See code: [src/commands/force/source/open.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.5/src/commands/force/source/open.ts)_ ## `sfdx force:source:retrieve [-p | -x | -m ] [-w ] [-n ] [-u ] [-a ] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` @@ -651,6 +668,6 @@ EXAMPLES $ sfdx force:source:retrieve -n MyPackageName -x path/to/package.xml ``` -_See code: [src/commands/force/source/retrieve.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.0/src/commands/force/source/retrieve.ts)_ +_See code: [src/commands/force/source/retrieve.ts](https://github.com/salesforcecli/plugin-source/blob/v1.2.5/src/commands/force/source/retrieve.ts)_ diff --git a/command-snapshot.json b/command-snapshot.json index 1a9d4f924..70166ef77 100644 --- a/command-snapshot.json +++ b/command-snapshot.json @@ -12,7 +12,7 @@ { "command": "force:source:beta:status", "plugin": "@salesforce/plugin-source", - "flags": ["all", "apiversion", "json", "local", "loglevel", "remote", "targetusername"] + "flags": ["apiversion", "json", "local", "loglevel", "remote", "targetusername"] }, { "command": "force:source:beta:tracking:clear", @@ -58,6 +58,8 @@ "loglevel", "manifest", "metadata", + "postdestructivechanges", + "predestructivechanges", "runtests", "soapdeploy", "sourcepath", diff --git a/messages/deploy.json b/messages/deploy.json index a546b350d..4d3b7f077 100644 --- a/messages/deploy.json +++ b/messages/deploy.json @@ -1,5 +1,5 @@ { - "description": "deploy source to an org\nUse this command to deploy source (metadata that’s in source format) to an org.\nTo take advantage of change tracking with scratch orgs, use \"sfdx force:source:push\".\nTo deploy metadata that’s in metadata format, use \"sfdx force:mdapi:deploy\".\n\nThe source you deploy overwrites the corresponding metadata in your org. This command does not attempt to merge your source with the versions in your org.\n\nTo run the command asynchronously, set --wait to 0, which immediately returns the job ID. This way, you can continue to use the CLI.\nTo check the status of the job, use force:source:deploy:report.\n\nIf the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes. On Windows, if the list contains commas, also enclose the entire list in one set of double quotes.\n", + "description": "deploy source to an org\nUse this command to deploy source (metadata that’s in source format) to an org.\nTo take advantage of change tracking with scratch orgs, use \"sfdx force:source:push\".\nTo deploy metadata that’s in metadata format, use \"sfdx force:mdapi:deploy\".\n\nThe source you deploy overwrites the corresponding metadata in your org. This command does not attempt to merge your source with the versions in your org.\n\nTo run the command asynchronously, set --wait to 0, which immediately returns the job ID. This way, you can continue to use the CLI.\nTo check the status of the job, use force:source:deploy:report.\n\nIf the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes. On Windows, if the list contains commas, also enclose the entire list in one set of double quotes.\n If you use the --manifest, --predestructivechanges, or --postdestructivechanges parameters, run the force:source:manifest:create command to easily generate the different types of manifest files.", "examples": [ "To deploy the source files in a directory:\n\t $ sfdx force:source:deploy -p path/to/source", "To deploy a specific Apex class and the objects whose source is in a directory: \n\t$ sfdx force:source:deploy -p \"path/to/apex/classes/MyClass.cls,path/to/source/objects\"", @@ -11,7 +11,9 @@ "To deploy all components listed in a manifest:\n $ sfdx force:source:deploy -x path/to/package.xml", "To run the tests that aren’t in any managed packages as part of a deployment:\n $ sfdx force:source:deploy -m ApexClass -l RunLocalTests", "To check whether a deployment would succeed (to prepare for Quick Deploy):\n $ sfdx force:source:deploy -m ApexClass -l RunAllTestsInOrg -c", - "To deploy an already validated deployment (Quick Deploy):\n $ sfdx force:source:deploy -q 0Af9A00000FTM6pSAH`," + "To deploy an already validated deployment (Quick Deploy):\n $ sfdx force:source:deploy -q 0Af9A00000FTM6pSAH`", + "To run a destructive operation before the deploy occurs:\n $ sfdx force:source:deploy --manifest package.xml --predestructivechanges destructiveChangesPre.xml", + "To run a destructive operation after the deploy occurs:\n $ sfdx force:source:deploy --manifest package.xml --postdestructivechanges destructiveChangesPost.xml" ], "flags": { "sourcePath": "comma-separated list of source file paths to deploy", @@ -25,7 +27,9 @@ "ignoreErrors": "ignore any errors and do not roll back deployment", "ignoreWarnings": "whether a warning will allow a deployment to complete successfully", "validateDeployRequestId": "deploy request ID of the validated deployment to run a Quick Deploy", - "soapDeploy": "deploy metadata with SOAP API instead of REST API" + "soapDeploy": "deploy metadata with SOAP API instead of REST API", + "predestructivechanges": "file path for a manifest (destructiveChangesPre.xml) of components to delete before the deploy", + "postdestructivechanges": "file path for a manifest (destructiveChangesPost.xml) of components to delete after the deploy" }, "flagsLong": { "sourcePath": [ diff --git a/messages/pull.json b/messages/pull.json index 8d0c628ed..b307365ee 100644 --- a/messages/pull.json +++ b/messages/pull.json @@ -10,5 +10,8 @@ "NonScratchOrgPull": "We can\"t retrieve your changes. \"force:source:pull\" is only available for orgs that have source tracking enabled. Use \"force:source:retrieve\" or \"force:mdapi:retrieve\" instead.", "sourceConflictDetected": "Source conflict(s) detected.", "pull": "Your retrieve request did not complete within the specified wait time [%s minutes]. Try again with a longer wait time.", - "retrievedSourceHeader": "Retrieved Source" + "retrievedSourceHeader": "Retrieved Source", + "NoResultsFound": "No results found", + "retrievedSourceWarningsHeader": "Retrieved Source Warnings", + "retrieveTimeout": "Your retrieve request did not complete within the specified wait time [%s minutes]. Try again with a longer wait time." } diff --git a/package.json b/package.json index f71128219..ec87259db 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@salesforce/plugin-source", "description": "Commands to interact with source formatted metadata", - "version": "1.2.1", + "version": "1.2.6", "author": "Salesforce", "bugs": "https://github.com/forcedotcom/cli/issues", "dependencies": { "@oclif/config": "^1", "@salesforce/command": "^4.1.3", "@salesforce/core": "^2.28.0", - "@salesforce/source-deploy-retrieve": "^4.5.2", - "@salesforce/source-tracking": "^0.2.2", + "@salesforce/source-deploy-retrieve": "^5.0.1", + "@salesforce/source-tracking": "^0.4.0", "chalk": "^4.1.2", "cli-ux": "^5.6.3", "open": "^8.2.1", @@ -34,6 +34,7 @@ "@typescript-eslint/parser": "^4.33.0", "chai": "^4.3.4", "chai-each": "^0.0.1", + "cross-env": "^7.0.3", "cz-conventional-changelog": "^3.3.0", "debug": "^4.3.2", "eslint": "^7.32.0", @@ -137,18 +138,28 @@ "test": "sf-test", "test:command-reference": "./bin/run commandreference:generate --erroronwarnings", "test:deprecation-policy": "./bin/run snapshot:compare", - "test:nuts": "ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:convert": "PLUGIN_SOURCE_SEED_FILTER=\"convert\" ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:delete": "nyc mocha \"test/nuts/delete.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:deploy": "PLUGIN_SOURCE_SEED_FILTER=\"deploy\" ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:folders": "nyc mocha \"test/nuts/folderTypes.nut.ts\" --slow 4500 --timeout 600000", - "test:nuts:manifest:create": "nyc mocha \"test/nuts/create.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:retrieve": "PLUGIN_SOURCE_SEED_FILTER=\"retrieve\" ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", - "test:nuts:territory2": "nyc mocha \"test/nuts/territory2.nut.ts\" --slow 4500 --timeout 600000 --retries 0", - "test:nuts:tracking": "nyc mocha \"test/nuts/trackingCommands/*.nut.ts\" --slow 3000 --timeout 600000 --parallel --retries 0", - "test:nuts:tracking:basics": "nyc mocha \"test/nuts/trackingCommands/basics.nut.ts\" --slow 3000 --timeout 600000 --retries 0", - "test:nuts:tracking:conflicts": "nyc mocha \"test/nuts/trackingCommands/conflicts.nut.ts\" --slow 3000 --timeout 600000 --retries 0", - "test:nuts:tracking:remote": "nyc mocha \"test/nuts/trackingCommands/remoteChanges.nut.ts\" --slow 3000 --timeout 600000 --retries 0", + "test:nuts": "cross-env PLUGIN_SOURCE_SEED_EXCLUDE=deploy.async ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:convert": "cross-env PLUGIN_SOURCE_SEED_FILTER=convert ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:delete": "mocha \"test/nuts/delete.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy PLUGIN_SOURCE_SEED_EXCLUDE=async ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:async": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.async ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:destructive": "mocha \"test/nuts/deployDestructive.nut.ts\" --slow 3000 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:manifest": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.manifest ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:metadata": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.metadata ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:quick": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.quick ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:sourcepath": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.sourcepath ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:deploy:testlevel": "cross-env PLUGIN_SOURCE_SEED_FILTER=deploy.testlevel ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:folders": "mocha \"test/nuts/folderTypes.nut.ts\" --slow 4500 --timeout 600000", + "test:nuts:manifest:create": "mocha \"test/nuts/create.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:retrieve": "cross-env PLUGIN_SOURCE_SEED_FILTER=retrieve ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --retries 0", + "test:nuts:specialTypes": "mocha \"test/nuts/territory2.nut.ts\" \"test/nuts/folderTypes.nut.ts\" --slow 4500 --timeout 600000 --retries 0 --parallel", + "test:nuts:territory2": "mocha \"test/nuts/territory2.nut.ts\" --slow 4500 --timeout 600000 --retries 0", + "test:nuts:tracking": "mocha \"test/nuts/trackingCommands/*.nut.ts\" --slow 3000 --timeout 600000 --parallel --retries 0", + "test:nuts:tracking:basics": "mocha \"test/nuts/trackingCommands/basics.nut.ts\" --slow 3000 --timeout 600000 --retries 0", + "test:nuts:tracking:conflicts": "mocha \"test/nuts/trackingCommands/conflicts.nut.ts\" --slow 3000 --timeout 600000 --retries 0", + "test:nuts:tracking:forceignore": "mocha \"test/nuts/trackingCommands/forceIgnore.nut.ts\" --slow 3000 --timeout 600000 --retries 0", + "test:nuts:tracking:remote": "mocha \"test/nuts/trackingCommands/remoteChanges.nut.ts\" --slow 3000 --timeout 600000 --retries 0", + "test:nuts:tracking:resetClear": "mocha \"test/nuts/trackingCommands/resetClear.nut.ts\" --slow 3000 --timeout 600000 --retries 0", "version": "oclif-dev readme" }, "husky": { diff --git a/src/commands/force/source/beta/pull.ts b/src/commands/force/source/beta/pull.ts index d30725c57..2f7555cc3 100644 --- a/src/commands/force/source/beta/pull.ts +++ b/src/commands/force/source/beta/pull.ts @@ -23,7 +23,7 @@ import { PullResponse, PullResultFormatter } from '../../../../formatters/pullFo Messages.importMessagesDirectory(__dirname); const messages: Messages = Messages.loadMessages('@salesforce/plugin-source', 'pull'); -export default class SourcePull extends SourceCommand { +export default class Pull extends SourceCommand { public static description = messages.getMessage('description'); public static help = messages.getMessage('help'); protected static readonly flagsConfig: FlagsConfig = { @@ -42,7 +42,6 @@ export default class SourcePull extends SourceCommand { protected static requiresUsername = true; protected static requiresProject = true; - protected hidden = true; protected readonly lifecycleEventNames = ['preretrieve', 'postretrieve']; protected tracking: SourceTracking; protected retrieveResult: RetrieveResult; @@ -148,7 +147,7 @@ export default class SourcePull extends SourceCommand { await this.lifecycle.emit('preretrieve', componentSet.toArray()); this.retrieveResult = await mdapiRetrieve.pollStatus(1000, this.getFlag('wait').seconds); - // assume: remote deletes that get deleted locally don't fire hooks? + // Assume: remote deletes that get deleted locally don't fire hooks. await this.lifecycle.emit('postretrieve', this.retrieveResult.getFileResponses()); } diff --git a/src/commands/force/source/beta/push.ts b/src/commands/force/source/beta/push.ts index 5c2e65b6f..918aef9a1 100644 --- a/src/commands/force/source/beta/push.ts +++ b/src/commands/force/source/beta/push.ts @@ -10,10 +10,9 @@ import { Duration, env } from '@salesforce/kit'; import { Messages } from '@salesforce/core'; import { RequestStatus, ComponentStatus } from '@salesforce/source-deploy-retrieve'; -// TODO: move to plugin-source import { SourceTracking, throwIfInvalid, replaceRenamedCommands } from '@salesforce/source-tracking'; import { DeployCommand } from '../../../../deployCommand'; -import { DeployResultFormatter, DeployCommandResult } from '../../../../formatters/deployResultFormatter'; +import { PushResponse, PushResultFormatter } from '../../../../formatters/pushResultFormatter'; import { ProgressFormatter } from '../../../../formatters/progressFormatter'; import { DeployProgressBarFormatter } from '../../../../formatters/deployProgressBarFormatter'; import { DeployProgressStatusFormatter } from '../../../../formatters/deployProgressStatusFormatter'; @@ -22,7 +21,7 @@ import { processConflicts } from '../../../../formatters/conflicts'; Messages.importMessagesDirectory(__dirname); const messages: Messages = Messages.loadMessages('@salesforce/plugin-source', 'push'); -export default class SourcePush extends DeployCommand { +export default class Push extends DeployCommand { public static description = messages.getMessage('description'); public static help = messages.getMessage('help'); protected static readonly flagsConfig: FlagsConfig = { @@ -48,11 +47,10 @@ export default class SourcePush extends DeployCommand { protected static requiresUsername = true; protected static requiresProject = true; protected readonly lifecycleEventNames = ['predeploy', 'postdeploy']; - protected hidden = true; private isRest = false; - public async run(): Promise { + public async run(): Promise { await this.deploy(); this.resolveSuccess(); return this.formatResult(); @@ -77,6 +75,7 @@ export default class SourcePush extends DeployCommand { processConflicts(await tracking.getConflicts(), this.ux, messages.getMessage('conflictMsg')); } const componentSet = await tracking.localChangesAsComponentSet(); + componentSet.sourceApiVersion = await this.getSourceApiVersion(); // there might have been components in local tracking, but they might be ignored by SDR or unresolvable. // SDR will throw when you try to resolve them, so don't @@ -87,11 +86,15 @@ export default class SourcePush extends DeployCommand { // fire predeploy event for sync and async deploys await this.lifecycle.emit('predeploy', componentSet.toArray()); - this.ux.log(`*** Deploying with ${this.isRest ? 'REST' : 'SOAP'} API ***`); + this.ux.log(`*** Pushing with ${this.isRest ? 'REST' : 'SOAP'} API v${componentSet.sourceApiVersion} ***`); const deploy = await componentSet.deploy({ usernameOrConnection: this.org.getUsername(), - apiOptions: { ignoreWarnings: (this.flags.ignoreWarnings as boolean) || false, rest: this.isRest }, + apiOptions: { + ignoreWarnings: this.getFlag('ignorewarnings', false), + rest: this.isRest, + testLevel: 'NoTestRun', + }, }); // we're not print JSON output @@ -109,9 +112,12 @@ export default class SourcePush extends DeployCommand { const successNonDeletes = successes.filter((fileResponse) => fileResponse.state !== ComponentStatus.Deleted); const successDeletes = successes.filter((fileResponse) => fileResponse.state === ComponentStatus.Deleted); - await Promise.all([ + if (this.deployResult) { // Only fire the postdeploy event when we have results. I.e., not async. - this.deployResult ? this.lifecycle.emit('postdeploy', this.deployResult) : Promise.resolve(), + await this.lifecycle.emit('postdeploy', this.deployResult); + } + + await Promise.all([ tracking.updateLocalTracking({ files: successNonDeletes.map((fileResponse) => fileResponse.filePath), deletedFiles: successDeletes.map((fileResponse) => fileResponse.filePath), @@ -127,7 +133,7 @@ export default class SourcePush extends DeployCommand { } } - protected formatResult(): DeployCommandResult { + protected formatResult(): PushResponse[] { if (!this.deployResult) { this.ux.log('No results found'); } @@ -135,7 +141,7 @@ export default class SourcePush extends DeployCommand { verbose: this.getFlag('verbose', false), }; - const formatter = new DeployResultFormatter(this.logger, this.ux, formatterOptions, this.deployResult); + const formatter = new PushResultFormatter(this.logger, this.ux, formatterOptions, this.deployResult); // Only display results to console when JSON flag is unset. if (!this.isJsonOutput()) { diff --git a/src/commands/force/source/beta/status.ts b/src/commands/force/source/beta/status.ts index be9ce3d77..082733de8 100644 --- a/src/commands/force/source/beta/status.ts +++ b/src/commands/force/source/beta/status.ts @@ -8,44 +8,37 @@ import * as os from 'os'; import { FlagsConfig, flags, SfdxCommand } from '@salesforce/command'; import { Messages } from '@salesforce/core'; - import { SourceTracking, throwIfInvalid, replaceRenamedCommands, - getKeyFromObject, - getKeyFromStrings, ChangeResult, + StatusOutputRow, } from '@salesforce/source-tracking'; - import { StatusResult, StatusFormatter } from '../../../../formatters/statusFormatter'; Messages.importMessagesDirectory(__dirname); const messages: Messages = Messages.loadMessages('@salesforce/plugin-source', 'status'); -export default class SourceStatus extends SfdxCommand { +export default class Status extends SfdxCommand { public static description = messages.getMessage('description'); public static readonly examples = replaceRenamedCommands(messages.getMessage('examples')).split(os.EOL); protected static flagsConfig: FlagsConfig = { - all: flags.boolean({ - char: 'a', - description: messages.getMessage('flags.all'), - longDescription: messages.getMessage('flags.allLong'), - }), local: flags.boolean({ char: 'l', description: messages.getMessage('flags.local'), longDescription: messages.getMessage('flags.localLong'), + exclusive: ['remote'], }), remote: flags.boolean({ char: 'r', description: messages.getMessage('flags.remote'), longDescription: messages.getMessage('flags.remoteLong'), + exclusive: ['local'], }), }; protected static requiresUsername = true; protected static requiresProject = true; - protected hidden = true; protected results = new Array(); protected localAdds: ChangeResult[] = []; @@ -56,10 +49,9 @@ export default class SourceStatus extends SfdxCommand { toValidate: 'plugin-source', command: replaceRenamedCommands('force:source:status'), }); - const wantsLocal = - (this.flags.local as boolean) || (this.flags.all as boolean) || (!this.flags.remote && !this.flags.all); - const wantsRemote = - (this.flags.remote as boolean) || (this.flags.all as boolean) || (!this.flags.local && !this.flags.all); + + const wantsLocal = (this.flags.local as boolean) || (!this.flags.remote && !this.flags.local); + const wantsRemote = (this.flags.remote as boolean) || (!this.flags.remote && !this.flags.local); this.logger.debug( `project is ${this.project.getPath()} and pkgDirs are ${this.project @@ -72,56 +64,8 @@ export default class SourceStatus extends SfdxCommand { project: this.project, apiVersion: this.flags.apiversion as string, }); - - if (wantsLocal) { - await tracking.ensureLocalTracking(); - const localDeletes = tracking.populateTypesAndNames({ - elements: await tracking.getChanges({ origin: 'local', state: 'delete', format: 'ChangeResult' }), - excludeUnresolvable: true, - resolveDeleted: true, - }); - - const localAdds = tracking.populateTypesAndNames({ - elements: await tracking.getChanges({ origin: 'local', state: 'add', format: 'ChangeResult' }), - excludeUnresolvable: true, - }); - - const localModifies = tracking.populateTypesAndNames({ - elements: await tracking.getChanges({ origin: 'local', state: 'modify', format: 'ChangeResult' }), - excludeUnresolvable: true, - }); - - this.results = this.results.concat( - localAdds.flatMap((item) => this.statusResultToOutputRows(item, 'add')), - localModifies.flatMap((item) => this.statusResultToOutputRows(item, 'changed')), - localDeletes.flatMap((item) => this.statusResultToOutputRows(item, 'delete')) - ); - } - - if (wantsRemote) { - // by initializeWithQuery true, one query runs so that parallel getChanges aren't doing parallel queries - await tracking.ensureRemoteTracking(true); - const [remoteDeletes, remoteModifies] = await Promise.all([ - tracking.getChanges({ origin: 'remote', state: 'delete', format: 'ChangeResult' }), - tracking.getChanges({ origin: 'remote', state: 'nondelete', format: 'ChangeResult' }), - ]); - this.results = this.results.concat( - remoteDeletes.flatMap((item) => this.statusResultToOutputRows(item)), - remoteModifies.flatMap((item) => this.statusResultToOutputRows(item)) - ); - } - - if (wantsLocal && wantsRemote) { - // keys like ApexClass__MyClass.cls - const conflictKeys = (await tracking.getConflicts()).map((conflict) => getKeyFromObject(conflict)); - if (conflictKeys.length > 0) { - this.results = this.results.map((row) => - conflictKeys.includes(getKeyFromStrings(row.type, row.fullName)) - ? { ...row, state: `${row.state} (Conflict)` } - : row - ); - } - } + const stlStatusResult = await tracking.getStatus({ local: wantsLocal, remote: wantsRemote }); + this.results = stlStatusResult.map((result) => resultConverter(result)); return this.formatResult(); } @@ -135,35 +79,38 @@ export default class SourceStatus extends SfdxCommand { return formatter.getJson(); } - - private statusResultToOutputRows(input: ChangeResult, localType?: 'delete' | 'changed' | 'add'): StatusResult[] { - this.logger.debug('converting ChangeResult to a row', input); - - const state = (): string => { - if (localType) { - return localType[0].toUpperCase() + localType.substring(1); - } - if (input.deleted) { - return 'Delete'; - } - if (input.modified) { - return 'Changed'; - } - return 'Add'; - }; - const baseObject = { - type: input.type ?? '', - state: `${input.origin} ${state()}`, - fullName: input.name ?? '', - }; - this.logger.debug(baseObject); - - if (!input.filenames) { - return [baseObject]; - } - return input.filenames.map((filename) => ({ - ...baseObject, - filepath: filename, - })); - } } + +/** + * STL provides a more useful json output. + * This function makes it consistent with the Status command's json. + */ +const resultConverter = (input: StatusOutputRow): StatusResult => { + const { fullName, type, ignored, filePath, conflict } = input; + const origin = originMap.get(input.origin); + const actualState = stateMap.get(input.state); + return { + fullName, + type, + // this string became the place to store information. + // The JSON now breaks out that info but preserves this property for backward compatibility + state: `${origin} ${actualState}${conflict ? ' (Conflict)' : ''}`, + ignored, + filePath, + origin, + actualState, + conflict, + }; +}; + +const originMap = new Map([ + ['local', 'Local'], + ['remote', 'Remote'], +]); + +const stateMap = new Map([ + ['delete', 'Deleted'], + ['add', 'Add'], + ['modify', 'Changed'], + ['nondelete', 'Changed'], +]); diff --git a/src/commands/force/source/beta/tracking/clear.ts b/src/commands/force/source/beta/tracking/clear.ts index e11ce5446..d88e68089 100644 --- a/src/commands/force/source/beta/tracking/clear.ts +++ b/src/commands/force/source/beta/tracking/clear.ts @@ -17,7 +17,7 @@ export type SourceTrackingClearResult = { clearedFiles: string[]; }; -export class SourceTrackingClearCommand extends SfdxCommand { +export class Clear extends SfdxCommand { public static readonly description = replaceRenamedCommands(messages.getMessage('clearDescription')); public static readonly requiresProject = true; @@ -30,7 +30,6 @@ export class SourceTrackingClearCommand extends SfdxCommand { required: false, }), }; - protected hidden = true; public async run(): Promise { throwIfInvalid({ diff --git a/src/commands/force/source/beta/tracking/reset.ts b/src/commands/force/source/beta/tracking/reset.ts index 90095c075..c0d4546f2 100644 --- a/src/commands/force/source/beta/tracking/reset.ts +++ b/src/commands/force/source/beta/tracking/reset.ts @@ -18,7 +18,7 @@ export type SourceTrackingResetResult = { localPathsSynced: number; }; -export class SourceTrackingResetCommand extends SfdxCommand { +export class Reset extends SfdxCommand { public static readonly description = replaceRenamedCommands(messages.getMessage('resetDescription')); public static readonly requiresProject = true; @@ -35,7 +35,6 @@ export class SourceTrackingResetCommand extends SfdxCommand { description: messages.getMessage('nopromptDescription'), }), }; - protected hidden = true; public async run(): Promise { throwIfInvalid({ diff --git a/src/commands/force/source/delete.ts b/src/commands/force/source/delete.ts index 8a39dba21..3e24f25d5 100644 --- a/src/commands/force/source/delete.ts +++ b/src/commands/force/source/delete.ts @@ -9,7 +9,13 @@ import * as fs from 'fs'; import { confirm } from 'cli-ux/lib/prompt'; import { flags, FlagsConfig } from '@salesforce/command'; import { Messages } from '@salesforce/core'; -import { ComponentSet, MetadataComponent, RequestStatus, SourceComponent } from '@salesforce/source-deploy-retrieve'; +import { + ComponentSet, + DestructiveChangesType, + MetadataComponent, + RequestStatus, + SourceComponent, +} from '@salesforce/source-deploy-retrieve'; import { Duration, env, once } from '@salesforce/kit'; import { getString } from '@salesforce/ts-types'; import { DeployCommand } from '../../../deployCommand'; @@ -119,10 +125,10 @@ export class Delete extends DeployCommand { const cs = new ComponentSet([]); this.components.map((component) => { if (component instanceof SourceComponent) { - cs.add(component, true); + cs.add(component, DestructiveChangesType.POST); } else { // a remote-only delete - cs.add(new SourceComponent({ name: component.fullName, type: component.type }), true); + cs.add(new SourceComponent({ name: component.fullName, type: component.type }), DestructiveChangesType.POST); } }); this.componentSet = cs; diff --git a/src/commands/force/source/deploy.ts b/src/commands/force/source/deploy.ts index 093d5aa78..8913b57f8 100644 --- a/src/commands/force/source/deploy.ts +++ b/src/commands/force/source/deploy.ts @@ -8,12 +8,11 @@ import * as os from 'os'; import { flags, FlagsConfig } from '@salesforce/command'; import { Messages } from '@salesforce/core'; import { AsyncResult, DeployResult, RequestStatus } from '@salesforce/source-deploy-retrieve'; -import { Duration } from '@salesforce/kit'; +import { Duration, env, once } from '@salesforce/kit'; import { getString, isString } from '@salesforce/ts-types'; -import { env, once } from '@salesforce/kit'; import { DeployCommand } from '../../../deployCommand'; import { ComponentSetBuilder } from '../../../componentSetBuilder'; -import { DeployResultFormatter, DeployCommandResult } from '../../../formatters/deployResultFormatter'; +import { DeployCommandResult, DeployResultFormatter } from '../../../formatters/deployResultFormatter'; import { DeployAsyncResultFormatter, DeployCommandAsyncResult } from '../../../formatters/deployAsyncResultFormatter'; import { ProgressFormatter } from '../../../formatters/progressFormatter'; import { DeployProgressBarFormatter } from '../../../formatters/deployProgressBarFormatter'; @@ -107,6 +106,14 @@ export class Deploy extends DeployCommand { longDescription: messages.getMessage('flagsLong.manifest'), exclusive: ['metadata', 'sourcepath'], }), + predestructivechanges: flags.filepath({ + description: messages.getMessage('flags.predestructivechanges'), + dependsOn: ['manifest'], + }), + postdestructivechanges: flags.filepath({ + description: messages.getMessage('flags.postdestructivechanges'), + dependsOn: ['manifest'], + }), }; protected xorFlags = ['manifest', 'metadata', 'sourcepath', 'validateddeployrequestid']; protected readonly lifecycleEventNames = ['predeploy', 'postdeploy']; @@ -149,6 +156,8 @@ export class Deploy extends DeployCommand { manifest: this.flags.manifest && { manifestPath: this.getFlag('manifest'), directoryPaths: this.getPackageDirs(), + destructiveChangesPre: this.getFlag('predestructivechanges'), + destructiveChangesPost: this.getFlag('postdestructivechanges'), }, metadata: this.flags.metadata && { metadataEntries: this.getFlag('metadata'), diff --git a/src/componentSetBuilder.ts b/src/componentSetBuilder.ts index 04e3d9e13..81694963d 100644 --- a/src/componentSetBuilder.ts +++ b/src/componentSetBuilder.ts @@ -7,11 +7,13 @@ import * as path from 'path'; import { ComponentSet, RegistryAccess } from '@salesforce/source-deploy-retrieve'; -import { fs, SfdxError, Logger } from '@salesforce/core'; +import { fs, Logger, SfdxError } from '@salesforce/core'; export type ManifestOption = { manifestPath: string; directoryPaths: string[]; + destructiveChangesPre?: string; + destructiveChangesPost?: string; }; export type MetadataOption = { metadataEntries: string[]; @@ -21,6 +23,7 @@ export type ComponentSetOptions = { packagenames?: string[]; sourcepath?: string[]; manifest?: ManifestOption; + metadata?: MetadataOption; apiversion?: string; sourceapiversion?: string; @@ -68,6 +71,8 @@ export class ComponentSetBuilder { manifestPath: manifest.manifestPath, resolveSourcePaths: options.manifest.directoryPaths, forceAddWildcards: true, + destructivePre: options.manifest.destructiveChangesPre, + destructivePost: options.manifest.destructiveChangesPost, }); } diff --git a/src/deployCommand.ts b/src/deployCommand.ts index ad0017f5b..cb83c8e18 100644 --- a/src/deployCommand.ts +++ b/src/deployCommand.ts @@ -6,7 +6,7 @@ */ import { ComponentSet, DeployResult, MetadataApiDeployStatus } from '@salesforce/source-deploy-retrieve'; -import { SfdxError, ConfigFile, ConfigAggregator, PollingClient, StatusResult } from '@salesforce/core'; +import { ConfigAggregator, ConfigFile, PollingClient, SfdxError, StatusResult } from '@salesforce/core'; import { AnyJson, asString, getBoolean } from '@salesforce/ts-types'; import { Duration, once } from '@salesforce/kit'; import { SourceCommand } from './sourceCommand'; @@ -21,7 +21,6 @@ export abstract class DeployCommand extends SourceCommand { }); protected deployResult: DeployResult; - /** * Request a report of an in-progess or completed deployment. * diff --git a/src/formatters/deployResultFormatter.ts b/src/formatters/deployResultFormatter.ts index 5baf112fb..ab51f1cf7 100644 --- a/src/formatters/deployResultFormatter.ts +++ b/src/formatters/deployResultFormatter.ts @@ -8,14 +8,14 @@ import * as chalk from 'chalk'; import { UX } from '@salesforce/command'; import { Logger, Messages, SfdxError } from '@salesforce/core'; -import { get, getBoolean, getString, getNumber, asString } from '@salesforce/ts-types'; +import { asString, get, getBoolean, getNumber, getString } from '@salesforce/ts-types'; import { - DeployResult, CodeCoverage, + DeployMessage, + DeployResult, FileResponse, MetadataApiDeployStatus, RequestStatus, - DeployMessage, } from '@salesforce/source-deploy-retrieve'; import { ResultFormatter, ResultFormatterOptions, toArray } from './resultFormatter'; @@ -76,6 +76,7 @@ export class DeployResultFormatter extends ResultFormatter { throw new SfdxError(messages.getMessage('deployCanceled', [canceledByName]), 'DeployFailed'); } this.displaySuccesses(); + this.displayDeletions(); this.displayFailures(); this.displayTestResults(); @@ -107,7 +108,7 @@ export class DeployResultFormatter extends ResultFormatter { protected displaySuccesses(): void { if (this.isSuccess() && this.fileResponses?.length) { - const successes = this.fileResponses.filter((f) => f.state !== 'Failed'); + const successes = this.fileResponses.filter((f) => !['Failed', 'Deleted'].includes(f.state)); if (!successes.length) { return; } @@ -126,6 +127,25 @@ export class DeployResultFormatter extends ResultFormatter { } } + protected displayDeletions(): void { + const deletions = this.fileResponses.filter((f) => f.state === 'Deleted'); + if (!deletions.length) { + return; + } + this.sortFileResponses(deletions); + this.asRelativePaths(deletions); + + this.ux.log(''); + this.ux.styledHeader(chalk.blue('Deleted Source')); + this.ux.table(deletions, { + columns: [ + { key: 'fullName', label: 'FULL NAME' }, + { key: 'type', label: 'TYPE' }, + { key: 'filePath', label: 'PROJECT PATH' }, + ], + }); + } + protected displayFailures(): void { if (this.hasStatus(RequestStatus.Failed)) { const failures: Array = []; diff --git a/src/formatters/pushResultFormatter.ts b/src/formatters/pushResultFormatter.ts new file mode 100644 index 000000000..6de455190 --- /dev/null +++ b/src/formatters/pushResultFormatter.ts @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2020, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + */ + +import * as chalk from 'chalk'; +import { UX } from '@salesforce/command'; +import { Logger, Messages, SfdxError } from '@salesforce/core'; +import { getString } from '@salesforce/ts-types'; +import { DeployResult, FileResponse, RequestStatus, DeployMessage } from '@salesforce/source-deploy-retrieve'; +import { ResultFormatter, ResultFormatterOptions, toArray } from './resultFormatter'; + +Messages.importMessagesDirectory(__dirname); +const messages = Messages.loadMessages('@salesforce/plugin-source', 'push'); + +export type PushResponse = Pick; + +export class PushResultFormatter extends ResultFormatter { + protected result: DeployResult; + protected fileResponses: FileResponse[]; + + public constructor(logger: Logger, ux: UX, options: ResultFormatterOptions, result: DeployResult) { + super(logger, ux, options); + this.result = result; + this.fileResponses = result?.getFileResponses ? result.getFileResponses() : []; + } + + /** + * Get the JSON output from the DeployResult. + * + * @returns a JSON formatted result matching the provided type. + */ + public getJson(): PushResponse[] { + return this.fileResponses.map(({ state, fullName, type, filePath }) => ({ state, fullName, type, filePath })); + } + + /** + * Displays deploy results in human readable format. Output can vary based on: + * + * 1. Verbose option + * 3. Checkonly deploy (checkonly=true) + * 4. Deploy with test results + * 5. Canceled status + */ + public display(): void { + this.displaySuccesses(); + this.displayFailures(); + + // Throw a DeployFailed error unless the deployment was successful. + if (!this.isSuccess()) { + throw new SfdxError(messages.getMessage('sourcepushFailed'), 'PushFailed'); + } + } + + protected hasStatus(status: RequestStatus): boolean { + return getString(this.result, 'response.status') === status; + } + + protected displaySuccesses(): void { + if (this.isSuccess() && this.fileResponses?.length) { + const successes = this.fileResponses.filter((f) => f.state !== 'Failed'); + if (!successes.length) { + return; + } + this.sortFileResponses(successes); + this.asRelativePaths(successes); + + this.ux.log(''); + this.ux.styledHeader(chalk.blue('Pushed Source')); + this.ux.table(successes, { + columns: [ + { key: 'state', label: 'STATE' }, + { key: 'fullName', label: 'FULL NAME' }, + { key: 'type', label: 'TYPE' }, + { key: 'filePath', label: 'PROJECT PATH' }, + ], + }); + } + } + + protected displayFailures(): void { + if (this.hasStatus(RequestStatus.Failed)) { + const failures: Array = []; + const fileResponseFailures: Map = new Map(); + + if (this.fileResponses?.length) { + const fileResponses: FileResponse[] = []; + this.fileResponses + .filter((f) => f.state === 'Failed') + .map((f: FileResponse & { error: string }) => { + fileResponses.push(f); + fileResponseFailures.set(`${f.type}#${f.fullName}`, f.error); + }); + this.sortFileResponses(fileResponses); + this.asRelativePaths(fileResponses); + failures.push(...fileResponses); + } + + const deployMessages = toArray(this.result?.response?.details?.componentFailures); + if (deployMessages.length > failures.length) { + // if there's additional failures in the API response, find the failure and add it to the output + deployMessages.map((deployMessage) => { + if (!fileResponseFailures.has(`${deployMessage.componentType}#${deployMessage.fullName}`)) { + // duplicate the problem message to the error property for displaying in the table + failures.push(Object.assign(deployMessage, { error: deployMessage.problem })); + } + }); + } + + this.ux.log(''); + this.ux.styledHeader(chalk.red(`Component Failures [${failures.length}]`)); + this.ux.table(failures, { + columns: [ + { key: 'problemType', label: 'Type' }, + { key: 'fullName', label: 'Name' }, + { key: 'error', label: 'Problem' }, + ], + }); + this.ux.log(''); + } + } +} diff --git a/src/formatters/statusFormatter.ts b/src/formatters/statusFormatter.ts index fdcf6e641..bcf573da0 100644 --- a/src/formatters/statusFormatter.ts +++ b/src/formatters/statusFormatter.ts @@ -11,11 +11,18 @@ import { ResultFormatter, ResultFormatterOptions } from './resultFormatter'; Messages.importMessagesDirectory(__dirname); const messages: Messages = Messages.loadMessages('@salesforce/plugin-source', 'status'); +type StatusActualState = 'Deleted' | 'Add' | 'Changed' | 'Unchanged'; +type StatusOrigin = 'Local' | 'Remote'; +type StatusStateString = `${StatusOrigin} ${StatusActualState}` | `${StatusOrigin} ${StatusActualState} (Conflict)`; export interface StatusResult { - state: string; + state: StatusStateString; fullName: string; type: string; filePath?: string; + ignored?: boolean; + conflict?: boolean; + actualState?: StatusActualState; + origin: StatusOrigin; } // sort order is state, type, fullname @@ -49,7 +56,7 @@ export class StatusFormatter extends ResultFormatter { { label: 'STATE', key: 'state' }, { label: 'FULL NAME', key: 'fullName' }, { label: 'TYPE', key: 'type' }, - { label: 'PROJECT PATH', key: 'filepath' }, + { label: 'PROJECT PATH', key: 'filePath' }, ], }); } diff --git a/test/commands/source/componentSetBuilder.test.ts b/test/commands/source/componentSetBuilder.test.ts index 5794964ed..8043f84bb 100644 --- a/test/commands/source/componentSetBuilder.test.ts +++ b/test/commands/source/componentSetBuilder.test.ts @@ -321,6 +321,8 @@ describe('ComponentSetBuilder', () => { forceAddWildcards: true, manifestPath: options.manifest.manifestPath, resolveSourcePaths: [packageDir1], + destructivePre: undefined, + destructivePost: undefined, }); expect(compSet.size).to.equal(1); expect(compSet.has(apexClassComponent)).to.equal(true); @@ -348,6 +350,8 @@ describe('ComponentSetBuilder', () => { forceAddWildcards: true, manifestPath: options.manifest.manifestPath, resolveSourcePaths: [packageDir1, packageDir2], + destructivePre: undefined, + destructivePost: undefined, }); expect(compSet.size).to.equal(2); expect(compSet.has(apexClassComponent)).to.equal(true); diff --git a/test/commands/source/deploy.test.ts b/test/commands/source/deploy.test.ts index 21c7f43ad..806369729 100644 --- a/test/commands/source/deploy.test.ts +++ b/test/commands/source/deploy.test.ts @@ -10,14 +10,14 @@ import * as sinon from 'sinon'; import { expect } from 'chai'; import { MetadataApiDeployOptions } from '@salesforce/source-deploy-retrieve'; import { fromStub, stubInterface, stubMethod } from '@salesforce/ts-sinon'; -import { ConfigAggregator, Lifecycle, Org, SfdxProject, Messages } from '@salesforce/core'; +import { ConfigAggregator, Lifecycle, Messages, Org, SfdxProject } from '@salesforce/core'; import { UX } from '@salesforce/command'; import { IConfig } from '@oclif/config'; import { Deploy } from '../../../src/commands/force/source/deploy'; import { DeployCommandResult, DeployResultFormatter } from '../../../src/formatters/deployResultFormatter'; import { - DeployCommandAsyncResult, DeployAsyncResultFormatter, + DeployCommandAsyncResult, } from '../../../src/formatters/deployAsyncResultFormatter'; import { ComponentSetBuilder, ComponentSetOptions } from '../../../src/componentSetBuilder'; import { DeployProgressBarFormatter } from '../../../src/formatters/deployProgressBarFormatter'; @@ -223,6 +223,8 @@ describe('force:source:deploy', () => { manifest: { manifestPath: manifest, directoryPaths: [defaultDir], + destructiveChangesPost: undefined, + destructiveChangesPre: undefined, }, }); ensureDeployArgs(); @@ -240,6 +242,8 @@ describe('force:source:deploy', () => { manifest: { manifestPath: manifest, directoryPaths: [defaultDir], + destructiveChangesPost: undefined, + destructiveChangesPre: undefined, }, }); ensureDeployArgs(); @@ -258,6 +262,8 @@ describe('force:source:deploy', () => { manifest: { manifestPath: manifest, directoryPaths: [defaultDir], + destructiveChangesPost: undefined, + destructiveChangesPre: undefined, }, }); ensureDeployArgs(); @@ -284,6 +290,8 @@ describe('force:source:deploy', () => { manifest: { manifestPath: manifest, directoryPaths: [defaultDir], + destructiveChangesPost: undefined, + destructiveChangesPre: undefined, }, }); diff --git a/test/nuts/deployDestructive.nut.ts b/test/nuts/deployDestructive.nut.ts new file mode 100644 index 000000000..11a64588c --- /dev/null +++ b/test/nuts/deployDestructive.nut.ts @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2020, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + */ + +import * as path from 'path'; +import * as os from 'os'; +import { expect } from 'chai'; +import { execCmd } from '@salesforce/cli-plugins-testkit'; +import { SourceTestkit } from '@salesforce/source-testkit'; +import { AuthInfo, Connection } from '@salesforce/core'; + +describe('source:delete NUTs', () => { + const executable = path.join(process.cwd(), 'bin', 'run'); + let testkit: SourceTestkit; + + const createApexClass = (apexName = 'myApexClass') => { + // create and deploy an ApexClass that can be deleted without dependency issues + const output = path.join('force-app', 'main', 'default', 'classes'); + const pathToClass = path.join(testkit.projectDir, output, `${apexName}.cls`); + execCmd(`force:apex:class:create --classname ${apexName} --outputdir ${output}`); + execCmd(`force:source:deploy -m ApexClass:${apexName}`); + return { apexName, output, pathToClass }; + }; + + const createManifest = (metadata: string, manifesttype: string) => { + execCmd(`force:source:manifest:create --metadata ${metadata} --manifesttype ${manifesttype}`); + }; + + const isNameObsolete = async (memberType: string, memberName: string): Promise => { + const connection = await Connection.create({ + authInfo: await AuthInfo.create({ username: testkit.username }), + }); + + const res = await connection.singleRecordQuery<{ IsNameObsolete: boolean }>( + `SELECT IsNameObsolete FROM SourceMember WHERE MemberType='${memberType}' AND MemberName='${memberName}'`, + { tooling: true } + ); + + return res.IsNameObsolete; + }; + + before(async () => { + testkit = await SourceTestkit.create({ + nut: __filename, + executable: os.platform() === 'win32' ? executable.replace(/\\/g, '\\\\') : executable, + repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', + }); + execCmd('force:source:deploy --sourcepath force-app'); + }); + + after(async () => { + await testkit?.clean(); + }); + + describe('destructive changes POST', () => { + it('should deploy and then delete an ApexClass ', async () => { + const { apexName } = createApexClass(); + let deleted = await isNameObsolete('ApexClass', apexName); + + expect(deleted).to.be.false; + createManifest('ApexClass:GeocodingService', 'package'); + createManifest(`ApexClass:${apexName}`, 'post'); + + execCmd('force:source:deploy --json --manifest package.xml --postdestructivechanges destructiveChangesPost.xml', { + ensureExitCode: 0, + }); + + deleted = await isNameObsolete('ApexClass', apexName); + expect(deleted).to.be.true; + }); + }); + + describe('destructive changes PRE', () => { + it('should delete an ApexClass and then deploy a class', async () => { + const { apexName } = createApexClass(); + let deleted = await isNameObsolete('ApexClass', apexName); + + expect(deleted).to.be.false; + createManifest('ApexClass:GeocodingService', 'package'); + createManifest(`ApexClass:${apexName}`, 'pre'); + + execCmd('force:source:deploy --json --manifest package.xml --predestructivechanges destructiveChangesPre.xml', { + ensureExitCode: 0, + }); + + deleted = await isNameObsolete('ApexClass', apexName); + expect(deleted).to.be.true; + }); + }); + + describe('destructive changes POST and PRE', () => { + it('should delete a class, then deploy and then delete an ApexClass', async () => { + const pre = createApexClass('pre').apexName; + const post = createApexClass('post').apexName; + let preDeleted = await isNameObsolete('ApexClass', pre); + let postDeleted = await isNameObsolete('ApexClass', post); + + expect(preDeleted).to.be.false; + expect(postDeleted).to.be.false; + createManifest('ApexClass:GeocodingService', 'package'); + createManifest(`ApexClass:${post}`, 'post'); + createManifest(`ApexClass:${pre}`, 'pre'); + + execCmd( + 'force:source:deploy --json --manifest package.xml --postdestructivechanges destructiveChangesPost.xml --predestructivechanges destructiveChangesPre.xml', + { + ensureExitCode: 0, + } + ); + + preDeleted = await isNameObsolete('ApexClass', pre); + postDeleted = await isNameObsolete('ApexClass', post); + expect(preDeleted).to.be.true; + expect(postDeleted).to.be.true; + }); + }); + + describe('errors', () => { + it('should throw an error when a pre destructive flag is passed without the manifest flag', async () => { + const { apexName } = createApexClass(); + + createManifest('ApexClass:GeocodingService', 'package'); + createManifest(`ApexClass:${apexName}`, 'pre'); + + try { + execCmd('force:source:deploy --json --sourcepath force-app --predestructivechanges destructiveChangesPre.xml'); + } catch (e) { + const err = e as Error; + expect(err).to.not.be.undefined; + expect(err.message).to.include('Error: --manifest= must also be provided when using --predestructivechanges='); + } + }); + + it('should throw an error when a post destructive flag is passed without the manifest flag', async () => { + const { apexName } = createApexClass(); + + createManifest('ApexClass:GeocodingService', 'package'); + createManifest(`ApexClass:${apexName}`, 'pre'); + + try { + execCmd('force:source:deploy --json --sourcepath force-app --postdestructivechanges destructiveChangesPre.xml'); + } catch (e) { + const err = e as Error; + expect(err).to.not.be.undefined; + expect(err.message).to.include('Error: --manifest= must also be provided when using --postdestructivechanges='); + } + }); + + it("should throw an error when a destructive manifest is passed that doesn't exist", () => { + createManifest('ApexClass:GeocodingService', 'package'); + + try { + execCmd('force:source:deploy --json --manifest package.xml --predestructivechanges doesntexist.xml'); + } catch (e) { + const err = e as Error; + expect(err).to.not.be.undefined; + expect(err.message).to.include("ENOENT: no such file or directory, open 'doesntexist.xml'"); + } + }); + }); +}); diff --git a/test/nuts/ebikes-lwc/.eslintignore b/test/nuts/ebikes-lwc/.eslintignore deleted file mode 100644 index 3dcf5f40e..000000000 --- a/test/nuts/ebikes-lwc/.eslintignore +++ /dev/null @@ -1,13 +0,0 @@ -**/lwc/**/*.css -**/lwc/**/*.html -**/lwc/**/*.json -**/lwc/**/*.svg -**/lwc/**/*.xml -**/aura/**/*.auradoc -**/aura/**/*.cmp -**/aura/**/*.css -**/aura/**/*.design -**/aura/**/*.json -**/aura/**/*.svg -**/aura/**/*.xml -.sfdx diff --git a/test/nuts/ebikes-lwc/.forceignore b/test/nuts/ebikes-lwc/.forceignore deleted file mode 100644 index 98229cb70..000000000 --- a/test/nuts/ebikes-lwc/.forceignore +++ /dev/null @@ -1,129 +0,0 @@ -# .forceignore v2 - -# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status -# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm -# - -# Standard metadata -package.xml -**/appMenu/** -**/appSwitcher/** -**/objectTranslations/** -**/settings/** - -# LWC configuration files -**/jsconfig.json -**/.eslintrc.json - -# LWC Jest -**/__tests__/** - -# Default generated Community metadata -**/aura/createAndRefreshCase -**/aura/forgotPassword -**/aura/loginForm -**/aura/selfRegister -**/aura/setExpId -**/aura/setStartUrl -**/classes/ChangePasswordController.cls -**/classes/ChangePasswordController.cls-meta.xml -**/classes/ChangePasswordControllerTest.cls -**/classes/ChangePasswordControllerTest.cls-meta.xml -**/classes/CommunitiesLandingController.cls -**/classes/CommunitiesLandingController.cls-meta.xml -**/classes/CommunitiesLandingControllerTest.cls -**/classes/CommunitiesLandingControllerTest.cls-meta.xml -**/classes/CommunitiesLoginController.cls -**/classes/CommunitiesLoginController.cls-meta.xml -**/classes/CommunitiesLoginControllerTest.cls -**/classes/CommunitiesLoginControllerTest.cls-meta.xml -**/classes/CommunitiesSelfRegConfirmController.cls -**/classes/CommunitiesSelfRegConfirmController.cls-meta.xml -**/classes/CommunitiesSelfRegConfirmControllerTest.cls -**/classes/CommunitiesSelfRegConfirmControllerTest.cls-meta.xml -**/classes/CommunitiesSelfRegController.cls -**/classes/CommunitiesSelfRegController.cls-meta.xml -**/classes/CommunitiesSelfRegControllerTest.cls -**/classes/CommunitiesSelfRegControllerTest.cls-meta.xml -**/classes/ForgotPasswordController.cls -**/classes/ForgotPasswordController.cls-meta.xml -**/classes/ForgotPasswordControllerTest.cls -**/classes/ForgotPasswordControllerTest.cls-meta.xml -**/classes/LightningForgotPasswordController.cls -**/classes/LightningForgotPasswordController.cls-meta.xml -**/classes/LightningForgotPasswordControllerTest.cls -**/classes/LightningForgotPasswordControllerTest.cls-meta.xml -**/classes/LightningLoginFormController.cls -**/classes/LightningLoginFormController.cls-meta.xml -**/classes/LightningLoginFormControllerTest.cls -**/classes/LightningLoginFormControllerTest.cls-meta.xml -**/classes/LightningSelfRegisterController.cls -**/classes/LightningSelfRegisterController.cls-meta.xml -**/classes/LightningSelfRegisterControllerTest.cls -**/classes/LightningSelfRegisterControllerTest.cls-meta.xml -**/classes/MyProfilePageController.cls -**/classes/MyProfilePageController.cls-meta.xml -**/classes/MyProfilePageControllerTest.cls -**/classes/MyProfilePageControllerTest.cls-meta.xml -**/classes/SiteLoginController.cls -**/classes/SiteLoginController.cls-meta.xml -**/classes/SiteLoginControllerTest.cls -**/classes/SiteLoginControllerTest.cls-meta.xml -**/classes/SiteRegisterController.cls -**/classes/SiteRegisterController.cls-meta.xml -**/classes/SiteRegisterControllerTest.cls -**/classes/SiteRegisterControllerTest.cls-meta.xml -**/components/SiteFooter.component -**/components/SiteFooter.component-meta.xml -**/components/SiteHeader.component -**/components/SiteHeader.component-meta.xml -**/components/SiteLogin.component -**/components/SiteLogin.component-meta.xml -**/components/SitePoweredBy.component -**/components/SitePoweredBy.component-meta.xml -**/pages/AnswersHome.page -**/pages/AnswersHome.page-meta.xml -**/pages/BandwidthExceeded.page -**/pages/BandwidthExceeded.page-meta.xml -**/pages/ChangePassword.page -**/pages/ChangePassword.page-meta.xml -#**/pages/CommunitiesLanding.page -#**/pages/CommunitiesLanding.page-meta.xml -**/pages/CommunitiesLogin.page -**/pages/CommunitiesLogin.page-meta.xml -**/pages/CommunitiesSelfReg.page -**/pages/CommunitiesSelfReg.page-meta.xml -**/pages/CommunitiesSelfRegConfirm.page -**/pages/CommunitiesSelfRegConfirm.page-meta.xml -**/pages/CommunitiesTemplate.page -**/pages/CommunitiesTemplate.page-meta.xml -**/pages/Exception.page -**/pages/Exception.page-meta.xml -**/pages/FileNotFound.page -**/pages/FileNotFound.page-meta.xml -**/pages/ForgotPassword.page -**/pages/ForgotPassword.page-meta.xml -**/pages/ForgotPasswordConfirm.page -**/pages/ForgotPasswordConfirm.page-meta.xml -**/pages/IdeasHome.page -**/pages/IdeasHome.page-meta.xml -**/pages/InMaintenance.page -**/pages/InMaintenance.page-meta.xml -**/pages/MyProfilePage.page -**/pages/MyProfilePage.page-meta.xml -**/pages/SiteLogin.page -**/pages/SiteLogin.page-meta.xml -**/pages/SiteRegister.page -**/pages/SiteRegister.page-meta.xml -**/pages/SiteRegisterConfirm.page -**/pages/SiteRegisterConfirm.page-meta.xml -**/pages/SiteTemplate.page -**/pages/SiteTemplate.page-meta.xml -**/pages/StdExceptionTemplate.page -**/pages/StdExceptionTemplate.page-meta.xml -**/pages/Unauthorized.page -**/pages/Unauthorized.page-meta.xml -**/pages/UnderConstruction.page -**/pages/UnderConstruction.page-meta.xml -**/staticresources/SiteSamples -**/staticresources/SiteSamples.resource-meta.xml diff --git a/test/nuts/ebikes-lwc/.github/CODEOWNERS b/test/nuts/ebikes-lwc/.github/CODEOWNERS deleted file mode 100644 index eb8cb56cf..000000000 --- a/test/nuts/ebikes-lwc/.github/CODEOWNERS +++ /dev/null @@ -1,3 +0,0 @@ -# Default owners for everything in the repo. -# They will be assigned for review on all PRs. -* @trailheadapps/maintainers-ebikes-lwc diff --git a/test/nuts/ebikes-lwc/.github/ISSUE_TEMPLATE/Bug_Report.md b/test/nuts/ebikes-lwc/.github/ISSUE_TEMPLATE/Bug_Report.md deleted file mode 100644 index 182d05da6..000000000 --- a/test/nuts/ebikes-lwc/.github/ISSUE_TEMPLATE/Bug_Report.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve this sample application. ---- - - - -### Summary - -_Short summary of what is going on or to provide context_. - -### Steps To Reproduce: - -1. This is step 1. -1. This is step 2. All steps should start with '1.' - -### Expected result - -_Describe what should have happened_. - -### Actual result - -_Describe what actually happened instead_. - -### Additional information - -_Feel free to attach a screenshot or code snippets_. diff --git a/test/nuts/ebikes-lwc/.github/ISSUE_TEMPLATE/Feature_Request.md b/test/nuts/ebikes-lwc/.github/ISSUE_TEMPLATE/Feature_Request.md deleted file mode 100644 index eb5f0054c..000000000 --- a/test/nuts/ebikes-lwc/.github/ISSUE_TEMPLATE/Feature_Request.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project ---- - - - -**What is missing from the application? Please describe.** -A clear and concise description of what the problem is. Ex. I'd like to see an implementation of [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/test/nuts/ebikes-lwc/.github/PULL_REQUEST_TEMPLATE.md b/test/nuts/ebikes-lwc/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 5740cf46f..000000000 --- a/test/nuts/ebikes-lwc/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,18 +0,0 @@ -### What does this PR do? - -### What issues does this PR fix or reference? - -# - -## The PR fulfills these requirements: - -[ ] Tests for the proposed changes have been added/updated. -[ ] Code linting and formatting was performed. - -### Functionality Before - - - -### Functionality After - - diff --git a/test/nuts/ebikes-lwc/.github/SUPPORT.md b/test/nuts/ebikes-lwc/.github/SUPPORT.md deleted file mode 100644 index 7583b9f7e..000000000 --- a/test/nuts/ebikes-lwc/.github/SUPPORT.md +++ /dev/null @@ -1,3 +0,0 @@ -**Looking for help?** - -Check out the [Lightning Web Components documentation](https://developer.salesforce.com/docs/component-library/documentation/lwc). diff --git a/test/nuts/ebikes-lwc/.github/dependabot.yml b/test/nuts/ebikes-lwc/.github/dependabot.yml deleted file mode 100644 index 7649c8745..000000000 --- a/test/nuts/ebikes-lwc/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -updates: - - package-ecosystem: npm - directory: '/' - schedule: - interval: monthly - open-pull-requests-limit: 10 diff --git a/test/nuts/ebikes-lwc/.github/workflows/auto-assign.yml b/test/nuts/ebikes-lwc/.github/workflows/auto-assign.yml deleted file mode 100644 index e48f3ba6d..000000000 --- a/test/nuts/ebikes-lwc/.github/workflows/auto-assign.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Issue assignment - -on: - issues: - types: [opened] - -jobs: - auto-assign: - runs-on: ubuntu-latest - steps: - - name: 'Auto-assign issue' - uses: pozil/auto-assign-issue@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: ${{ secrets.DEFAULT_ISSUE_ASSIGNEE }} diff --git a/test/nuts/ebikes-lwc/.github/workflows/ci-pr-prerelease.yml b/test/nuts/ebikes-lwc/.github/workflows/ci-pr-prerelease.yml deleted file mode 100644 index 5e30d3004..000000000 --- a/test/nuts/ebikes-lwc/.github/workflows/ci-pr-prerelease.yml +++ /dev/null @@ -1,123 +0,0 @@ -# Unique name for this workflow -name: CI on Pre-release PR - -# Definition when the workflow should run -on: - workflow_dispatch: - pull_request: - types: [opened, edited, synchronize, reopened] - branches: - - prerelease/spring[2-9][0-9] - - prerelease/summer[2-9][0-9] - - prerelease/winter[2-9][0-9] - -# Jobs to be executed -jobs: - format-lint-lwc-tests: - runs-on: ubuntu-latest - steps: - # Checkout the source code - - name: 'Checkout source code' - uses: actions/checkout@v2 - - # Cache node_modules to speed up the process - - name: 'Restore node_modules cache' - id: cache-npm - uses: actions/cache@v1 - with: - path: node_modules - key: npm-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - npm-${{ env.cache-name }}- - npm- - - # Install npm dependencies for Prettier and Jest - - name: 'Install npm dependencies' - if: steps.cache-npm.outputs.cache-hit != 'true' - run: npm ci - - # Prettier formatting - - name: 'Code formatting verification with Prettier' - run: npm run prettier:verify - - # Lint LWC - - name: 'Lint Lightning Web Components' - run: npm run lint:lwc - - # LWC unit tests - - name: 'Unit test Lightning Web Components' - run: npm run test:unit:coverage - - # Upload code coverage data - - name: 'Upload code coverage for LWC to Codecov.io' - uses: codecov/codecov-action@v2.0.2 - with: - flags: LWC - - scratch-org-test: - runs-on: ubuntu-latest - needs: format-lint-lwc-tests - if: ${{ github.actor != 'dependabot[bot]' }} - steps: - # Install Salesforce CLI - - name: 'Install Salesforce CLI' - run: | - wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz - mkdir ~/sfdx - tar xJf sfdx-linux-x64.tar.xz -C ~/sfdx --strip-components 1 - echo "$HOME/sfdx/bin" >> $GITHUB_PATH - ~/sfdx/bin/sfdx version - - # Checkout the source code - - name: 'Checkout source code' - uses: actions/checkout@v2 - - # Store secret for dev hub - - name: 'Populate auth file with DEVHUB_SFDX_URL secret' - shell: bash - run: | - echo ${{ secrets.DEVHUB_SFDX_URL}} > ./DEVHUB_SFDX_URL.txt - secretFileSize=$(wc -c "./DEVHUB_SFDX_URL.txt" | awk '{print $1}') - if [ $secretFileSize == 1 ]; then - echo "Missing DEVHUB_SFDX_URL secret. Is this workflow running on a fork?"; - exit 1; - fi - - # Authenticate dev hub - - name: 'Authenticate Dev Hub' - run: sfdx auth:sfdxurl:store -f ./DEVHUB_SFDX_URL.txt -a devhub -d - - # Create scratch org - - name: 'Create scratch org' - run: sfdx force:org:create -f config/project-scratch-def.json -a scratch-org -s -d 1 release=Preview - - # Deploy source to scratch org - - name: 'Push source to scratch org' - run: sfdx force:source:push - - # Assign permissionset - - name: 'Assign permissionset to default user' - run: sfdx force:user:permset:assign -n ebikes - - # Import sample data - - name: 'Import sample data' - run: sfdx force:data:tree:import -p ./data/sample-data-plan.json - - # Run Apex tests in scratch org - - name: 'Run Apex tests' - run: sfdx force:apex:test:run -c -r human -d ./tests/apex -w 20 - - # Delete temporary test file that Codecov is unable to parse - - name: 'Delete coverage file (temporary step)' - run: rm ./tests/apex/test-result-707*-codecoverage.json - - # Upload code coverage data - - name: 'Upload code coverage for Apex to Codecov.io' - uses: codecov/codecov-action@v2.0.2 - with: - flags: Apex - - # Housekeeping - - name: 'Delete scratch org' - if: always() - run: sfdx force:org:delete -p -u scratch-org diff --git a/test/nuts/ebikes-lwc/.github/workflows/ci-pr.yml b/test/nuts/ebikes-lwc/.github/workflows/ci-pr.yml deleted file mode 100644 index f29a428f4..000000000 --- a/test/nuts/ebikes-lwc/.github/workflows/ci-pr.yml +++ /dev/null @@ -1,129 +0,0 @@ -# Unique name for this workflow -name: CI on PR - -# Definition when the workflow should run -on: - workflow_dispatch: - pull_request: - types: [opened, edited, synchronize, reopened] - branches-ignore: - - prerelease/spring[2-9][0-9] - - prerelease/summer[2-9][0-9] - - prerelease/winter[2-9][0-9] - -# Jobs to be executed -jobs: - format-lint-lwc-tests: - runs-on: ubuntu-latest - steps: - # Checkout the source code - - name: 'Checkout source code' - uses: actions/checkout@v2 - - # Cache node_modules to speed up the process - - name: 'Restore node_modules cache' - id: cache-npm - uses: actions/cache@v1 - with: - path: node_modules - key: npm-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - npm-${{ env.cache-name }}- - npm- - - # Install npm dependencies for Prettier and Jest - - name: 'Install npm dependencies' - if: steps.cache-npm.outputs.cache-hit != 'true' - run: npm ci - - # Prettier formatting - - name: 'Code formatting verification with Prettier' - run: npm run prettier:verify - - # Lint LWC - - name: 'Lint Lightning Web Components' - run: npm run lint:lwc - - # LWC unit tests - - name: 'Unit test Lightning Web Components' - run: npm run test:unit:coverage - - # Upload code coverage data - - name: 'Upload code coverage for LWC to Codecov.io' - uses: codecov/codecov-action@v2.0.2 - with: - flags: LWC - - scratch-org-test: - runs-on: ubuntu-latest - needs: format-lint-lwc-tests - if: ${{ github.actor != 'dependabot[bot]' }} - steps: - # Install Salesforce CLI - - name: 'Install Salesforce CLI' - run: | - wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz - mkdir ~/sfdx - tar xJf sfdx-linux-x64.tar.xz -C ~/sfdx --strip-components 1 - echo "$HOME/sfdx/bin" >> $GITHUB_PATH - ~/sfdx/bin/sfdx version - - # Checkout the source code - - name: 'Checkout source code' - uses: actions/checkout@v2 - - # Store secret for dev hub - - name: 'Populate auth file with DEVHUB_SFDX_URL secret' - shell: bash - run: | - echo ${{ secrets.DEVHUB_SFDX_URL}} > ./DEVHUB_SFDX_URL.txt - secretFileSize=$(wc -c "./DEVHUB_SFDX_URL.txt" | awk '{print $1}') - if [ $secretFileSize == 1 ]; then - echo "Missing DEVHUB_SFDX_URL secret. Is this workflow running on a fork?"; - exit 1; - fi - - # Authenticate dev hub - - name: 'Authenticate Dev Hub' - run: sfdx auth:sfdxurl:store -f ./DEVHUB_SFDX_URL.txt -a devhub -d - - # Create scratch org - - name: 'Create scratch org' - run: sfdx force:org:create -f config/project-scratch-def.json -a scratch-org -s -d 1 - - # Wait for package replication - - name: 'Wait for two min for Communities activation' - uses: maddox/actions/sleep@master - with: - args: 120 - - # Deploy source to scratch org - - name: 'Push source to scratch org' - run: sfdx force:source:push - - # Assign permissionset - - name: 'Assign permissionset to default user' - run: sfdx force:user:permset:assign -n ebikes - - # Import sample data - - name: 'Import sample data' - run: sfdx force:data:tree:import -p ./data/sample-data-plan.json - - # Run Apex tests in scratch org - - name: 'Run Apex tests' - run: sfdx force:apex:test:run -c -r human -d ./tests/apex -w 20 - - # Delete temporary test file that Codecov is unable to parse - - name: 'Delete coverage file (temporary step)' - run: rm ./tests/apex/test-result-707*-codecoverage.json - - # Upload code coverage data - - name: 'Upload code coverage for Apex to Codecov.io' - uses: codecov/codecov-action@v2.0.2 - with: - flags: Apex - - # Housekeeping - - name: 'Delete scratch org' - if: always() - run: sfdx force:org:delete -p -u scratch-org diff --git a/test/nuts/ebikes-lwc/.github/workflows/ci.yml b/test/nuts/ebikes-lwc/.github/workflows/ci.yml deleted file mode 100644 index e765f179e..000000000 --- a/test/nuts/ebikes-lwc/.github/workflows/ci.yml +++ /dev/null @@ -1,126 +0,0 @@ -# Unique name for this workflow -name: CI - -# Definition when the workflow should run -on: - workflow_dispatch: - push: - branches: - - main - -# Jobs to be executed -jobs: - format-lint-lwc-tests: - runs-on: ubuntu-latest - steps: - # Checkout the source code - - name: 'Checkout source code' - uses: actions/checkout@v2 - - # Cache node_modules to speed up the process - - name: 'Restore node_modules cache' - id: cache-npm - uses: actions/cache@v1 - with: - path: node_modules - key: npm-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - npm-${{ env.cache-name }}- - npm- - - # Install npm dependencies for Prettier and Jest - - name: 'Install npm dependencies' - if: steps.cache-npm.outputs.cache-hit != 'true' - run: npm ci - - # Prettier formatting - - name: 'Code formatting verification with Prettier' - run: npm run prettier:verify - - # Lint LWC - - name: 'Lint Lightning Web Components' - run: npm run lint:lwc - - # LWC unit tests - - name: 'Unit test Lightning Web Components' - run: npm run test:unit:coverage - - # Upload code coverage data - - name: 'Upload code coverage for LWC to Codecov.io' - uses: codecov/codecov-action@v2.0.2 - with: - flags: LWC - - scratch-org-test: - runs-on: ubuntu-latest - needs: format-lint-lwc-tests - if: ${{ github.actor != 'dependabot[bot]' }} - steps: - # Install Salesforce CLI - - name: 'Install Salesforce CLI' - run: | - wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz - mkdir ~/sfdx - tar xJf sfdx-linux-x64.tar.xz -C ~/sfdx --strip-components 1 - echo "$HOME/sfdx/bin" >> $GITHUB_PATH - ~/sfdx/bin/sfdx version - - # Checkout the source code - - name: 'Checkout source code' - uses: actions/checkout@v2 - - # Store secret for dev hub - - name: 'Populate auth file with DEVHUB_SFDX_URL secret' - shell: bash - run: | - echo ${{ secrets.DEVHUB_SFDX_URL}} > ./DEVHUB_SFDX_URL.txt - secretFileSize=$(wc -c "./DEVHUB_SFDX_URL.txt" | awk '{print $1}') - if [ $secretFileSize == 1 ]; then - echo "Missing DEVHUB_SFDX_URL secret. Is this workflow running on a fork?"; - exit 1; - fi - - # Authenticate dev hub - - name: 'Authenticate Dev Hub' - run: sfdx auth:sfdxurl:store -f ./DEVHUB_SFDX_URL.txt -a devhub -d - - # Create scratch org - - name: 'Create scratch org' - run: sfdx force:org:create -f config/project-scratch-def.json -a scratch-org -s -d 1 - - # Wait for package replication - - name: 'Wait for two min for Communities activation' - uses: maddox/actions/sleep@master - with: - args: 120 - - # Deploy source to scratch org - - name: 'Push source to scratch org' - run: sfdx force:source:push - - # Assign permissionset - - name: 'Assign permissionset to default user' - run: sfdx force:user:permset:assign -n ebikes - - # Import sample data - - name: 'Import sample data' - run: sfdx force:data:tree:import -p ./data/sample-data-plan.json - - # Run Apex tests in scratch org - - name: 'Run Apex tests' - run: sfdx force:apex:test:run -c -r human -d ./tests/apex -w 20 - - # Delete temporary test file that Codecov is unable to parse - - name: 'Delete coverage file (temporary step)' - run: rm ./tests/apex/test-result-707*-codecoverage.json - - # Upload code coverage data - - name: 'Upload code coverage for Apex to Codecov.io' - uses: codecov/codecov-action@v2.0.2 - with: - flags: Apex - - # Housekeeping - - name: 'Delete scratch org' - if: always() - run: sfdx force:org:delete -p -u scratch-org diff --git a/test/nuts/ebikes-lwc/.github/workflows/codetour-watch.yml b/test/nuts/ebikes-lwc/.github/workflows/codetour-watch.yml deleted file mode 100644 index 64ee27aa3..000000000 --- a/test/nuts/ebikes-lwc/.github/workflows/codetour-watch.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: CodeTour watch - -on: - pull_request: - types: [opened, edited, synchronize, reopened] - -jobs: - codetour-watch: - runs-on: ubuntu-latest - steps: - - name: 'Checkout source code' - uses: actions/checkout@v2 - - - name: 'Watch CodeTour changes' - uses: pozil/codetour-watch@v1.2.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/test/nuts/ebikes-lwc/.github/workflows/stale.yml b/test/nuts/ebikes-lwc/.github/workflows/stale.yml deleted file mode 100644 index 50a942b2b..000000000 --- a/test/nuts/ebikes-lwc/.github/workflows/stale.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: 'Close stale issues and pull requests' -on: - schedule: - - cron: '0 0 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'Flagging this as stale, as there was no recent activity within the last 14 days. 🧐' - stale-pr-message: 'Ok, no one seems to work on this. Closing it now. 👋' - stale-issue-label: 'no-issue-activity' - stale-pr-label: 'no-pr-activity' - days-before-stale: 14 - days-before-close: 7 diff --git a/test/nuts/ebikes-lwc/.github/workflows/welcome.yml b/test/nuts/ebikes-lwc/.github/workflows/welcome.yml deleted file mode 100644 index cce3081ff..000000000 --- a/test/nuts/ebikes-lwc/.github/workflows/welcome.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Greeting - -on: - issues: - types: [opened] - -jobs: - comment: - runs-on: ubuntu-latest - steps: - - uses: rytswd/respost@v0.1.0 - with: - title: Welcome! 👋 - body: 'Thank you for posting this issue. 🙇🏼‍♂️ We will come back to you latest within the next 48h (working days). Stay tuned!' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/test/nuts/ebikes-lwc/.gitignore b/test/nuts/ebikes-lwc/.gitignore deleted file mode 100644 index b44fd24d9..000000000 --- a/test/nuts/ebikes-lwc/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ -# This file is used for Git repositories to specify intentionally untracked files that Git should ignore. -# If you are not using git, you can delete this file. For more information see: https://git-scm.com/docs/gitignore -# For useful gitignore templates see: https://github.com/github/gitignore - -# Salesforce dev -.sfdx/ -.localdevserver/ - -# LWC VSCode autocomplete -jsconfig.json - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Dependency directories -node_modules/ -yarn.lock - -# Eslint cache -.eslintcache - -# MacOS system files -.DS_Store - -# Windows system files -Thumbs.db -ehthumbs.db -[Dd]esktop.ini -$RECYCLE.BIN/ - -# VS Code project settings -.vscode/* -!.vscode/extensions.json - -# Codecov -coverage diff --git a/test/nuts/ebikes-lwc/.husky/.gitignore b/test/nuts/ebikes-lwc/.husky/.gitignore deleted file mode 100644 index 31354ec13..000000000 --- a/test/nuts/ebikes-lwc/.husky/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_ diff --git a/test/nuts/ebikes-lwc/.husky/pre-commit b/test/nuts/ebikes-lwc/.husky/pre-commit deleted file mode 100755 index 2601a3bb0..000000000 --- a/test/nuts/ebikes-lwc/.husky/pre-commit +++ /dev/null @@ -1 +0,0 @@ -npm run precommit \ No newline at end of file diff --git a/test/nuts/ebikes-lwc/.prettierignore b/test/nuts/ebikes-lwc/.prettierignore deleted file mode 100644 index 85456b316..000000000 --- a/test/nuts/ebikes-lwc/.prettierignore +++ /dev/null @@ -1,11 +0,0 @@ -# List files or directories below to ignore them when running prettier -# More information: https://prettier.io/docs/en/ignore.html -# - -lcc-react-js-bike-model/ -**/staticresources/** -.localdevserver -.sfdx -.vscode -jsconfig.json -coverage/ \ No newline at end of file diff --git a/test/nuts/ebikes-lwc/.prettierrc b/test/nuts/ebikes-lwc/.prettierrc deleted file mode 100644 index b4e9e8cad..000000000 --- a/test/nuts/ebikes-lwc/.prettierrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "trailingComma": "none", - "singleQuote": true, - "tabWidth": 4, - "overrides": [ - { - "files": "**/lwc/**/*.html", - "options": { "parser": "lwc" } - }, - { - "files": "*.{cmp,page,component}", - "options": { "parser": "html" } - } - ] -} diff --git a/test/nuts/ebikes-lwc/.tours/-welcome-to-e-bikes.tour b/test/nuts/ebikes-lwc/.tours/-welcome-to-e-bikes.tour deleted file mode 100644 index f6f491ed4..000000000 --- a/test/nuts/ebikes-lwc/.tours/-welcome-to-e-bikes.tour +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$schema": "https://aka.ms/codetour-schema", - "title": "👋 Welcome to E-Bikes", - "steps": [ - { - "title": "Property Explorer - Wire Decorator", - "file": "force-app/main/default/lwc/productTileList/productTileList.js", - "description": "The Product Explorer lets you browse thought E-Bikes products by displaying cards that contain the product and it's price. It gets these by using an @wire to query call the `getProducts` Apex method and providing the filter values that have been set.", - "line": 48 - }, - { - "title": "Property Explorer - Lightning Message Service", - "file": "force-app/main/default/lwc/productTileList/productTileList.js", - "description": "The LWC uses Lightning Message Service to publish a selected product using the `PRODUCT_SELECTED_MESSAGE` [Lightning message channel](https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_message_channel). This way, any components subscribing to the message will recieve the data when it is published.", - "line": 62 - }, - { - "title": "Product Card - Lightning Message Service", - "file": "force-app/main/default/lwc/productCard/productCard.js", - "description": "The product card subscribes to the `PRODUCT_SELECTED_MESSAGE` [Lightning message channel](https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_message_channel) and passes the payload to the handleRecordLoaded method which will query for and return the selected record.", - "line": 57 - }, - { - "title": "Similar Products - Api Decorator", - "file": "force-app/main/default/lwc/similarProducts/similarProducts.js", - "description": "The Similar Products component is accessed by a user on a record detail page. In LWC you can use the `@api recordId` property to gather the id from the pages context. ", - "line": 9 - }, - { - "title": "Similar Products - Wire Decorator", - "file": "force-app/main/default/lwc/similarProducts/similarProducts.js", - "description": "Using [Lightning Data Services](https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.data_ui_api), we can use an `@wire` to query for a records fields by passing in the `recordId` and the fields property that we have defined.", - "line": 15 - }, - { - "title": "Similar Products - Lightning Data Service", - "file": "force-app/main/default/lwc/similarProducts/similarProducts.html", - "description": "When the similarProducts are returned from the [Lightning Data Services](https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.data_ui_api) transaction, we can iterate over the result and pass the data into the Product List Item component.", - "line": 5 - }, - { - "title": "Product List Item - Navigation", - "file": "force-app/main/default/lwc/productListItem/productListItem.js", - "description": "Once the values have been populated by the parent component, in this case similarProducts, you can select an item to view it's details. In this case, we are using [Lightning Navigation Service](https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_navigate) to navigate to a record page and include the `recordId` and `objectApiName` to ensure that the user gets to the correct record.", - "line": 13 - } - ], - "ref": "sg/codetour", - "isPrimary": true -} \ No newline at end of file diff --git a/test/nuts/ebikes-lwc/.vscode/extensions.json b/test/nuts/ebikes-lwc/.vscode/extensions.json deleted file mode 100644 index 018b5ed97..000000000 --- a/test/nuts/ebikes-lwc/.vscode/extensions.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "recommendations": ["vsls-contrib.codetour"] -} diff --git a/test/nuts/ebikes-lwc/CODE_OF_CONDUCT.md b/test/nuts/ebikes-lwc/CODE_OF_CONDUCT.md deleted file mode 100644 index b5d6ac7cc..000000000 --- a/test/nuts/ebikes-lwc/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,105 +0,0 @@ -# Salesforce Open Source Community Code of Conduct - -## About the Code of Conduct - -Equality is a core value at Salesforce. We believe a diverse and inclusive -community fosters innovation and creativity, and are committed to building a -culture where everyone feels included. - -Salesforce open-source projects are committed to providing a friendly, safe, and -welcoming environment for all, regardless of gender identity and expression, -sexual orientation, disability, physical appearance, body size, ethnicity, nationality, -race, age, religion, level of experience, education, socioeconomic status, or -other similar personal characteristics. - -The goal of this code of conduct is to specify a baseline standard of behavior so -that people with different social values and communication styles can work -together effectively, productively, and respectfully in our open source community. -It also establishes a mechanism for reporting issues and resolving conflicts. - -All questions and reports of abusive, harassing, or otherwise unacceptable behavior -in a Salesforce open-source project may be reported by contacting the Salesforce -Open Source Conduct Committee at ossconduct@salesforce.com. - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of gender -identity and expression, sexual orientation, disability, physical appearance, -body size, ethnicity, nationality, race, age, religion, level of experience, education, -socioeconomic status, or other similar personal characteristics. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -- Using welcoming and inclusive language -- Being respectful of differing viewpoints and experiences -- Gracefully accepting constructive criticism -- Focusing on what is best for the community -- Showing empathy toward other community members - -Examples of unacceptable behavior by participants include: - -- The use of sexualized language or imagery and unwelcome sexual attention or - advances -- Personal attacks, insulting/derogatory comments, or trolling -- Public or private harassment -- Publishing, or threatening to publish, others' private information—such as - a physical or electronic address—without explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting -- Advocating for or encouraging any of the above behaviors - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned with this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project email -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the Salesforce Open Source Conduct Committee -at ossconduct@salesforce.com. All complaints will be reviewed and investigated -and will result in a response that is deemed necessary and appropriate to the -circumstances. The committee is obligated to maintain confidentiality with -regard to the reporter of an incident. Further details of specific enforcement -policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership and the Salesforce Open Source Conduct -Committee. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][contributor-covenant-home], -version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html. -It includes adaptions and additions from [Go Community Code of Conduct][golang-coc], -[CNCF Code of Conduct][cncf-coc], and [Microsoft Open Source Code of Conduct][microsoft-coc]. - -This Code of Conduct is licensed under the [Creative Commons Attribution 3.0 License][cc-by-3-us]. - -[contributor-covenant-home]: https://www.contributor-covenant.org 'https://www.contributor-covenant.org/' -[golang-coc]: https://golang.org/conduct -[cncf-coc]: https://github.com/cncf/foundation/blob/master/code-of-conduct.md -[microsoft-coc]: https://opensource.microsoft.com/codeofconduct/ -[cc-by-3-us]: https://creativecommons.org/licenses/by/3.0/us/ diff --git a/test/nuts/ebikes-lwc/CONTRIBUTION.md b/test/nuts/ebikes-lwc/CONTRIBUTION.md deleted file mode 100644 index 993899282..000000000 --- a/test/nuts/ebikes-lwc/CONTRIBUTION.md +++ /dev/null @@ -1,46 +0,0 @@ -## Contributing - -1. Familiarize yourself with the codebase. -1. Create a new issue before starting your project so that we can keep track of - what you are trying to add/fix. That way, we can also offer suggestions or - let you know if there is already an effort in progress. We will let you know when you're good to go to start. -1. Fork this repository. -1. The [README](README.md) has details on how to set up your environment. -1. Create a _topic_ branch in your fork based on the correct branch (usually the **main** branch. Note, this step is recommended but technically not required if contributing using a fork. -1. Edit the code in your fork. -1. Sign CLA (see [CLA](#cla) below) -1. Send us a pull request when you are done. We'll review your code, suggest any - needed changes, and merge it in. - -### CLA - -External contributors will be required to sign a Contributor's License -Agreement. You can do so by going to https://cla.salesforce.com/sign-cla. - -## Branches - -- We work in `main`. -- Our released (aka. _production_) branch is `main`. -- Our work happens in _topic_ branches (feature and/or bug-fix). - - feature as well as bug-fix branches are based on `main` - - branches _should_ be kept up-to-date using `rebase` - - see below for further merge instructions - -### Merging between branches - -- We try to limit merge commits as much as possible. - -- _Topic_ branches are: - - 1. based on `main` and will be - 1. squash-merged into `main`. - -## Pull Requests - -- Develop features and bug fixes in _topic_ branches. -- _Topic_ branches can live in forks (external contributors) or within this repository (committers). - \*\* When creating _topic_ branches in this repository please prefix with `/`. - -### Merging Pull Requests - -- Pull request merging is restricted to squash & merge only. diff --git a/test/nuts/ebikes-lwc/LICENSE b/test/nuts/ebikes-lwc/LICENSE deleted file mode 100644 index 0e259d42c..000000000 --- a/test/nuts/ebikes-lwc/LICENSE +++ /dev/null @@ -1,121 +0,0 @@ -Creative Commons Legal Code - -CC0 1.0 Universal - - CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE - LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN - ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS - INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES - REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS - PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM - THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED - HEREUNDER. - -Statement of Purpose - -The laws of most jurisdictions throughout the world automatically confer -exclusive Copyright and Related Rights (defined below) upon the creator -and subsequent owner(s) (each and all, an "owner") of an original work of -authorship and/or a database (each, a "Work"). - -Certain owners wish to permanently relinquish those rights to a Work for -the purpose of contributing to a commons of creative, cultural and -scientific works ("Commons") that the public can reliably and without fear -of later claims of infringement build upon, modify, incorporate in other -works, reuse and redistribute as freely as possible in any form whatsoever -and for any purposes, including without limitation commercial purposes. -These owners may contribute to the Commons to promote the ideal of a free -culture and the further production of creative, cultural and scientific -works, or to gain reputation or greater distribution for their Work in -part through the use and efforts of others. - -For these and/or other purposes and motivations, and without any -expectation of additional consideration or compensation, the person -associating CC0 with a Work (the "Affirmer"), to the extent that he or she -is an owner of Copyright and Related Rights in the Work, voluntarily -elects to apply CC0 to the Work and publicly distribute the Work under its -terms, with knowledge of his or her Copyright and Related Rights in the -Work and the meaning and intended legal effect of CC0 on those rights. - -1. Copyright and Related Rights. A Work made available under CC0 may be -protected by copyright and related or neighboring rights ("Copyright and -Related Rights"). Copyright and Related Rights include, but are not -limited to, the following: - - i. the right to reproduce, adapt, distribute, perform, display, - communicate, and translate a Work; - ii. moral rights retained by the original author(s) and/or performer(s); -iii. publicity and privacy rights pertaining to a person's image or - likeness depicted in a Work; - iv. rights protecting against unfair competition in regards to a Work, - subject to the limitations in paragraph 4(a), below; - v. rights protecting the extraction, dissemination, use and reuse of data - in a Work; - vi. database rights (such as those arising under Directive 96/9/EC of the - European Parliament and of the Council of 11 March 1996 on the legal - protection of databases, and under any national implementation - thereof, including any amended or successor version of such - directive); and -vii. other similar, equivalent or corresponding rights throughout the - world based on applicable law or treaty, and any national - implementations thereof. - -2. Waiver. To the greatest extent permitted by, but not in contravention -of, applicable law, Affirmer hereby overtly, fully, permanently, -irrevocably and unconditionally waives, abandons, and surrenders all of -Affirmer's Copyright and Related Rights and associated claims and causes -of action, whether now known or unknown (including existing as well as -future claims and causes of action), in the Work (i) in all territories -worldwide, (ii) for the maximum duration provided by applicable law or -treaty (including future time extensions), (iii) in any current or future -medium and for any number of copies, and (iv) for any purpose whatsoever, -including without limitation commercial, advertising or promotional -purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each -member of the public at large and to the detriment of Affirmer's heirs and -successors, fully intending that such Waiver shall not be subject to -revocation, rescission, cancellation, termination, or any other legal or -equitable action to disrupt the quiet enjoyment of the Work by the public -as contemplated by Affirmer's express Statement of Purpose. - -3. Public License Fallback. Should any part of the Waiver for any reason -be judged legally invalid or ineffective under applicable law, then the -Waiver shall be preserved to the maximum extent permitted taking into -account Affirmer's express Statement of Purpose. In addition, to the -extent the Waiver is so judged Affirmer hereby grants to each affected -person a royalty-free, non transferable, non sublicensable, non exclusive, -irrevocable and unconditional license to exercise Affirmer's Copyright and -Related Rights in the Work (i) in all territories worldwide, (ii) for the -maximum duration provided by applicable law or treaty (including future -time extensions), (iii) in any current or future medium and for any number -of copies, and (iv) for any purpose whatsoever, including without -limitation commercial, advertising or promotional purposes (the -"License"). The License shall be deemed effective as of the date CC0 was -applied by Affirmer to the Work. Should any part of the License for any -reason be judged legally invalid or ineffective under applicable law, such -partial invalidity or ineffectiveness shall not invalidate the remainder -of the License, and in such case Affirmer hereby affirms that he or she -will not (i) exercise any of his or her remaining Copyright and Related -Rights in the Work or (ii) assert any associated claims and causes of -action with respect to the Work, in either case contrary to Affirmer's -express Statement of Purpose. - -4. Limitations and Disclaimers. - - a. No trademark or patent rights held by Affirmer are waived, abandoned, - surrendered, licensed or otherwise affected by this document. - b. Affirmer offers the Work as-is and makes no representations or - warranties of any kind concerning the Work, express, implied, - statutory or otherwise, including without limitation warranties of - title, merchantability, fitness for a particular purpose, non - infringement, or the absence of latent or other defects, accuracy, or - the present or absence of errors, whether or not discoverable, all to - the greatest extent permissible under applicable law. - c. Affirmer disclaims responsibility for clearing rights of other persons - that may apply to the Work or any use thereof, including without - limitation any person's Copyright and Related Rights in the Work. - Further, Affirmer disclaims responsibility for obtaining any necessary - consents, permissions or other rights required for any use of the - Work. - d. Affirmer understands and acknowledges that Creative Commons is not a - party to this document and has no duty or obligation with respect to - this CC0 or use of the Work. diff --git a/test/nuts/ebikes-lwc/README.md b/test/nuts/ebikes-lwc/README.md deleted file mode 100644 index 5f2878e5f..000000000 --- a/test/nuts/ebikes-lwc/README.md +++ /dev/null @@ -1,3 +0,0 @@ -this is ebikes from github as of 8/30/2021 with the following changes - -1. remove profiles from the .forceignore diff --git a/test/nuts/ebikes-lwc/SECURITY.md b/test/nuts/ebikes-lwc/SECURITY.md deleted file mode 100644 index 824902573..000000000 --- a/test/nuts/ebikes-lwc/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -## Security - -Please report any security issue to [security@salesforce.com](mailto:security@salesforce.com) -as soon as it is discovered. This library limits its runtime dependencies in -order to reduce the total cost of ownership as much as can be, but all consumers -should remain vigilant and have their security stakeholders review all third-party -products (3PP) like this one and their dependencies. diff --git a/test/nuts/ebikes-lwc/bin/install-scratch.bat b/test/nuts/ebikes-lwc/bin/install-scratch.bat deleted file mode 100644 index 03ec02f8b..000000000 --- a/test/nuts/ebikes-lwc/bin/install-scratch.bat +++ /dev/null @@ -1,61 +0,0 @@ -@echo OFF - -rem Set parameters -set ORG_ALIAS=ebikes - -@echo: -echo Installing E-Bikes scratch org (%ORG_ALIAS%) -@echo: - -rem Install script -echo Cleaning previous scratch org... -cmd.exe /c sfdx force:org:delete -p -u %ORG_ALIAS% 2>NUL -@echo: - -echo Creating scratch org... -cmd.exe /c sfdx force:org:create -s -f config/project-scratch-def.json -d 30 -a %ORG_ALIAS% -call :checkForError -@echo: - -echo Pushing source... -cmd.exe /c sfdx force:source:push -call :checkForError -@echo: - -echo Assigning permission sets... -cmd.exe /c sfdx force:user:permset:assign -n ebikes -call :checkForError -@echo: -cd %CD%/.. - -echo Importing sample data... -cmd.exe /c sfdx force:data:tree:import -p data/sample-data-plan.json -call :checkForError -@echo: - -echo Sleeping 30s for Community deployment... -timeout /T 30 /NOBREAK -@echo: - -echo Publishing Community... -cmd.exe /c sfdx force:community:publish -n E-Bikes -call :checkForError -@echo: - -rem Report install success if no error -@echo: -if ["%errorlevel%"]==["0"] ( - echo Installation completed. - @echo: - cmd.exe /c sfdx force:org:open -p lightning/n/Product_Explorer -) - -:: ======== FN ====== -GOTO :EOF - -rem Display error if the install has failed -:checkForError -if NOT ["%errorlevel%"]==["0"] ( - echo Installation failed. - exit /b %errorlevel% -) \ No newline at end of file diff --git a/test/nuts/ebikes-lwc/bin/install-scratch.sh b/test/nuts/ebikes-lwc/bin/install-scratch.sh deleted file mode 100755 index 9c880663c..000000000 --- a/test/nuts/ebikes-lwc/bin/install-scratch.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) -cd $SCRIPT_PATH/.. - -# Set parameters -ORG_ALIAS="ebikes" - -echo "" -echo "Installing E-Bikes scratch org ($ORG_ALIAS)" -echo "" - -# Install script -echo "Cleaning previous scratch org..." -sfdx force:org:delete -p -u $ORG_ALIAS &> /dev/null -echo "" - -echo "Creating scratch org..." && \ -sfdx force:org:create -s -f config/project-scratch-def.json -d 30 -a $ORG_ALIAS && \ -echo "" && \ - -echo "Pushing source..." && \ -sfdx force:source:push && \ -echo "" && \ - -echo "Assigning permission sets..." && \ -sfdx force:user:permset:assign -n ebikes && \ -echo "" && \ - -echo "Importing sample data..." && \ -sfdx force:data:tree:import -p data/sample-data-plan.json && \ -echo "" && \ - -echo "Sleeping 30s for Community deployment" && \ -sleep 30 && \ -echo "" && \ - -echo "Publishing Community" && \ -sfdx force:community:publish -n E-Bikes && \ -echo "" && \ - -echo "Opening org..." && \ -sfdx force:org:open -p lightning/n/Product_Explorer && \ -echo "" - -EXIT_CODE="$?" -echo "" - -# Check exit code -echo "" -if [ "$EXIT_CODE" -eq 0 ]; then - echo "Installation completed." -else - echo "Installation failed." -fi -exit $EXIT_CODE diff --git a/test/nuts/ebikes-lwc/config/project-scratch-def.json b/test/nuts/ebikes-lwc/config/project-scratch-def.json deleted file mode 100644 index 9a12dab49..000000000 --- a/test/nuts/ebikes-lwc/config/project-scratch-def.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "orgName": "Ebikes", - "edition": "Developer", - "adminEmail": "nut@mailinator.com", - "hasSampleData": false, - "features": ["Communities", "Walkthroughs", "EnableSetPasswordInApi"], - "settings": { - "communitiesSettings": { - "enableNetworksEnabled": true - }, - "experienceBundleSettings": { - "enableExperienceBundleMetadata": true - }, - "lightningExperienceSettings": { - "enableS1DesktopEnabled": true - }, - "mobileSettings": { - "enableS1EncryptedStoragePref2": false - }, - "userEngagementSettings": { - "enableOrchestrationInSandbox": true - } - } -} diff --git a/test/nuts/ebikes-lwc/data/Accounts.json b/test/nuts/ebikes-lwc/data/Accounts.json deleted file mode 100644 index 9be72ef2f..000000000 --- a/test/nuts/ebikes-lwc/data/Accounts.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "records": [ - { - "attributes": { - "type": "Account", - "referenceId": "AccountRef1" - }, - "Name": "Wheelworks", - "BillingStreet": "480 Trapelo Road", - "BillingCity": "Belmont", - "BillingState": "MA", - "BillingPostalCode": "02478", - "BillingCountry": "USA" - }, - { - "attributes": { - "type": "Account", - "referenceId": "AccountRef2" - }, - "Name": "Northern Trail Cycling", - "BillingStreet": "415 Mission St", - "BillingCity": "San Francisco", - "BillingState": "CA", - "BillingPostalCode": "94105", - "BillingCountry": "USA" - }, - { - "attributes": { - "type": "Account", - "referenceId": "AccountRef3" - }, - "Name": "Trailblazers", - "BillingStreet": "1095 Avenue of the Americas", - "BillingCity": "New York", - "BillingState": "NY", - "BillingPostalCode": "10036", - "BillingCountry": "USA" - } - ] -} diff --git a/test/nuts/ebikes-lwc/data/Product_Family__cs.json b/test/nuts/ebikes-lwc/data/Product_Family__cs.json deleted file mode 100644 index 231e1edfa..000000000 --- a/test/nuts/ebikes-lwc/data/Product_Family__cs.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "records": [ - { - "attributes": { - "type": "Product_Family__c", - "referenceId": "DynamoRef" - }, - "Name": "Dynamo", - "Description__c": "Performance and reliability. The best choice for hobbyists and enthusiasts.", - "Category__c": "Mountain" - }, - { - "attributes": { - "type": "Product_Family__c", - "referenceId": "FuseRef" - }, - "Name": "Fuse", - "Description__c": "Commute and off-road? The Fuse bikes do it all!", - "Category__c": "Hybrid" - }, - { - "attributes": { - "type": "Product_Family__c", - "referenceId": "ElectraRef" - }, - "Name": "Electra", - "Description__c": "Top of the line commuter bikes that can handle long and challenging commutes.", - "Category__c": "Commuter" - }, - { - "attributes": { - "type": "Product_Family__c", - "referenceId": "VoltRef" - }, - "Name": "Volt", - "Description__c": "Fun and Foldable electric bicycles.", - "Category__c": "Commuter" - } - ] -} diff --git a/test/nuts/ebikes-lwc/data/Product__cs.json b/test/nuts/ebikes-lwc/data/Product__cs.json deleted file mode 100644 index 867758011..000000000 --- a/test/nuts/ebikes-lwc/data/Product__cs.json +++ /dev/null @@ -1,324 +0,0 @@ -{ - "records": [ - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef1" - }, - "Name": "FUSE X1", - "Product_Family__c": "@FuseRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 2500, - "Level__c": "Beginner", - "Category__c": "Commuter", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/fusex1.jpg", - "Battery__c": "401Wh", - "Charger__c": "41V4A", - "Motor__c": "251 watt, 75Nm", - "Fork__c": "Air spring", - "Front_Brakes__c": "Dual-pivot caliper brake", - "Rear_Brakes__c": "Dual-pivot caliper brake" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef2" - }, - "Name": "FUSE X2", - "Product_Family__c": "@FuseRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 2600, - "Level__c": "Beginner", - "Category__c": "Commuter", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/fusex2.jpg", - "Battery__c": "402Wh", - "Charger__c": "42V4A", - "Motor__c": "252 watt, 75Nm", - "Fork__c": "Air spring", - "Front_Brakes__c": "Dual-pivot caliper brake", - "Rear_Brakes__c": "Dual-pivot caliper brake" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef3" - }, - "Name": "FUSE X3", - "Product_Family__c": "@FuseRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 2700, - "Level__c": "Beginner", - "Category__c": "Commuter", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/fusex3.jpg", - "Battery__c": "403Wh", - "Charger__c": "43V4A", - "Motor__c": "253 watt, 75Nm", - "Fork__c": "Air spring", - "Front_Brakes__c": "Dual-pivot caliper brake", - "Rear_Brakes__c": "Dual-pivot caliper brake" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef4" - }, - "Name": "FUSE X4", - "Product_Family__c": "@FuseRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 2800, - "Level__c": "Beginner", - "Category__c": "Commuter", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/fusex4.jpg", - "Battery__c": "404Wh", - "Charger__c": "44V4A", - "Motor__c": "254 watt, 75Nm", - "Fork__c": "Air spring", - "Front_Brakes__c": "Dual-pivot caliper brake", - "Rear_Brakes__c": "Dual-pivot caliper brake" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef5" - }, - "Name": "DYNAMO X1", - "Product_Family__c": "@DynamoRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 7000, - "Level__c": "Racer", - "Category__c": "Mountain", - "Material__c": "Carbon", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/dynamox1.jpg", - "Battery__c": "501Wh", - "Charger__c": "41V4A", - "Motor__c": "281 watt, 75Nm", - "Fork__c": "Air spring, adjustable rebound", - "Front_Brakes__c": "Hydraulic disc, 200mm", - "Rear_Brakes__c": "Hydraulic disc, 200mm" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef6" - }, - "Name": "DYNAMO X2", - "Product_Family__c": "@DynamoRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 7200, - "Level__c": "Racer", - "Category__c": "Mountain", - "Material__c": "Carbon", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/dynamox2.jpg", - "Battery__c": "502Wh", - "Charger__c": "42V4A", - "Motor__c": "282 watt, 75Nm", - "Fork__c": "Air spring, adjustable rebound", - "Front_Brakes__c": "Hydraulic disc, 200mm", - "Rear_Brakes__c": "Hydraulic disc, 200mm" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef7" - }, - "Name": "DYNAMO X3", - "Product_Family__c": "@DynamoRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 7400, - "Level__c": "Racer", - "Category__c": "Mountain", - "Material__c": "Carbon", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/dynamox3.jpg", - "Battery__c": "503Wh", - "Charger__c": "43V4A", - "Motor__c": "283 watt, 75Nm", - "Fork__c": "Air spring, adjustable rebound", - "Front_Brakes__c": "Hydraulic disc, 200mm", - "Rear_Brakes__c": "Hydraulic disc, 200mm" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef8" - }, - "Name": "DYNAMO X4", - "Product_Family__c": "@DynamoRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 7800, - "Level__c": "Racer", - "Category__c": "Mountain", - "Material__c": "Carbon", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/dynamox4.jpg", - "Battery__c": "504Wh", - "Charger__c": "44V4A", - "Motor__c": "284 watt, 75Nm", - "Fork__c": "Air spring, adjustable rebound", - "Front_Brakes__c": "Hydraulic disc, 200mm", - "Rear_Brakes__c": "Hydraulic disc, 200mm" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef9" - }, - "Name": "ELECTRA X1", - "Product_Family__c": "@ElectraRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 4000, - "Level__c": "Enthusiast", - "Category__c": "Mountain", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/electrax1.jpg", - "Battery__c": "501Wh", - "Charger__c": "41V4A", - "Motor__c": "251 watt, 75Nm", - "Fork__c": "Air spring, adjustable rebound", - "Front_Brakes__c": "Hydraulic disc, 200mm", - "Rear_Brakes__c": "Hydraulic disc, 200mm" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef10" - }, - "Name": "ELECTRA X2", - "Product_Family__c": "@ElectraRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 4300, - "Level__c": "Enthusiast", - "Category__c": "Mountain", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/electrax2.jpg", - "Battery__c": "502Wh", - "Charger__c": "42V4A", - "Motor__c": "252 watt, 75Nm", - "Fork__c": "Air spring, adjustable rebound", - "Front_Brakes__c": "Hydraulic disc, 200mm", - "Rear_Brakes__c": "Hydraulic disc, 200mm" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef11" - }, - "Name": "ELECTRA X3", - "Product_Family__c": "@ElectraRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 4600, - "Level__c": "Enthusiast", - "Category__c": "Mountain", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/electrax3.jpg", - "Battery__c": "503Wh", - "Charger__c": "43V4A", - "Motor__c": "253 watt, 75Nm", - "Fork__c": "Air spring, adjustable rebound", - "Front_Brakes__c": "Hydraulic disc, 200mm", - "Rear_Brakes__c": "Hydraulic disc, 200mm" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef12" - }, - "Name": "ELECTRA X4", - "Product_Family__c": "@ElectraRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 4900, - "Level__c": "Enthusiast", - "Category__c": "Mountain", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/electrax4.jpg", - "Battery__c": "504Wh", - "Charger__c": "44V4A", - "Motor__c": "254 watt, 75Nm", - "Fork__c": "Air spring, adjustable rebound", - "Front_Brakes__c": "Hydraulic disc, 200mm", - "Rear_Brakes__c": "Hydraulic disc, 200mm" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef13" - }, - "Name": "VOLT X1", - "Product_Family__c": "@VoltRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 1200, - "Level__c": "Beginner", - "Category__c": "Commuter", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/voltx1.jpg", - "Battery__c": "300Wh", - "Charger__c": "21V4A", - "Motor__c": "251 watt, 75Nm", - "Fork__c": "Foldable", - "Front_Brakes__c": "Centre-pull caliper brake", - "Rear_Brakes__c": "Centre-pull caliper brake" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef14" - }, - "Name": "VOLT X2", - "Product_Family__c": "@VoltRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 1400, - "Level__c": "Beginner", - "Category__c": "Commuter", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/voltx2.jpg", - "Battery__c": "300Wh", - "Charger__c": "42V4A", - "Motor__c": "252 watt, 75Nm", - "Fork__c": "Foldable", - "Front_Brakes__c": "Centre-pull caliper brake", - "Rear_Brakes__c": "Centre-pull caliper brake" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef15" - }, - "Name": "VOLT X3", - "Product_Family__c": "@VoltRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 1800, - "Level__c": "Beginner", - "Category__c": "Commuter", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/voltx3.jpg", - "Battery__c": "300Wh", - "Charger__c": "23V4A", - "Motor__c": "253 watt, 75Nm", - "Fork__c": "Foldable", - "Front_Brakes__c": "Centre-pull caliper brake", - "Rear_Brakes__c": "Centre-pull caliper brake" - }, - { - "attributes": { - "type": "Product__c", - "referenceId": "Product__cRef16" - }, - "Name": "VOLT X4", - "Product_Family__c": "@VoltRef", - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "MSRP__c": 1900, - "Level__c": "Beginner", - "Category__c": "Commuter", - "Material__c": "Aluminum", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/voltx4.jpg", - "Battery__c": "300Wh", - "Charger__c": "24V4A", - "Motor__c": "254 watt, 75Nm", - "Fork__c": "Foldable", - "Front_Brakes__c": "Centre-pull caliper brake", - "Rear_Brakes__c": "Centre-pull caliper brake" - } - ] -} diff --git a/test/nuts/ebikes-lwc/data/sample-data-plan.json b/test/nuts/ebikes-lwc/data/sample-data-plan.json deleted file mode 100644 index cc072db57..000000000 --- a/test/nuts/ebikes-lwc/data/sample-data-plan.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "sobject": "Account__c", - "saveRefs": false, - "files": ["Accounts.json"] - }, - { - "sobject": "Product_Family__c", - "saveRefs": true, - "files": ["Product_Family__cs.json"] - }, - { - "sobject": "Product__c", - "resolveRefs": true, - "files": ["Product__cs.json"] - } -] diff --git a/test/nuts/ebikes-lwc/ebikes-logo.png b/test/nuts/ebikes-lwc/ebikes-logo.png deleted file mode 100644 index 19e95c902..000000000 Binary files a/test/nuts/ebikes-lwc/ebikes-logo.png and /dev/null differ diff --git a/test/nuts/ebikes-lwc/force-app/main/default/applications/EBikes.app-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/applications/EBikes.app-meta.xml deleted file mode 100644 index 6570e74d5..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/applications/EBikes.app-meta.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - #C23335 - logo - 1 - false - - - View - Action override created by Lightning App Builder on activation. Added manually because this isn't registered by force:source:pull. - Account_Record_Page - Large - false - Flexipage - Account - - Large - - Standard - standard-home - Product_Explorer - standard-Account - standard-Contact - Product__c - Order__c - Product_Family__c - Lightning - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.cmp b/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.cmp deleted file mode 100644 index 050e2ab19..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.cmp +++ /dev/null @@ -1,27 +0,0 @@ - - - - - -
- - - {!v.left} - - - {!v.center} - - - {!v.right} - - -
-
diff --git a/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.cmp-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.cmp-meta.xml deleted file mode 100644 index d8ba3b165..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.cmp-meta.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - 52.0 - A Lightning Component Bundle - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.css b/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.css deleted file mode 100644 index 8d0697d06..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.css +++ /dev/null @@ -1,3 +0,0 @@ -.THIS .center { - padding: 0 12px; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.design b/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.design deleted file mode 100644 index a7402cdd7..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.design +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.svg b/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.svg deleted file mode 100644 index 791b3c7e2..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/HeroDetailsPositionCustomPicklist.cls b/test/nuts/ebikes-lwc/force-app/main/default/classes/HeroDetailsPositionCustomPicklist.cls deleted file mode 100644 index 1c92e5735..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/HeroDetailsPositionCustomPicklist.cls +++ /dev/null @@ -1,20 +0,0 @@ -global class HeroDetailsPositionCustomPicklist extends VisualEditor.DynamicPickList { - global override VisualEditor.DataRow getDefaultValue() { - VisualEditor.DataRow defaultValue = new VisualEditor.DataRow( - 'Right', - 'right' - ); - return defaultValue; - } - global override VisualEditor.DynamicPickListRows getValues() { - VisualEditor.DataRow value1 = new VisualEditor.DataRow('Left', 'left'); - VisualEditor.DataRow value2 = new VisualEditor.DataRow( - 'Right', - 'right' - ); - VisualEditor.DynamicPickListRows myValues = new VisualEditor.DynamicPickListRows(); - myValues.addRow(value1); - myValues.addRow(value2); - return myValues; - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/HeroDetailsPositionCustomPicklist.cls-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/classes/HeroDetailsPositionCustomPicklist.cls-meta.xml deleted file mode 100644 index f8e5ab635..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/HeroDetailsPositionCustomPicklist.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 52.0 - Active - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/OrderController.cls b/test/nuts/ebikes-lwc/force-app/main/default/classes/OrderController.cls deleted file mode 100644 index 1069d896f..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/OrderController.cls +++ /dev/null @@ -1,19 +0,0 @@ -public with sharing class OrderController { - @AuraEnabled(Cacheable=true) - public static Order_Item__c[] getOrderItems(Id orderId) { - return [ - SELECT - Id, - Qty_S__c, - Qty_M__c, - Qty_L__c, - Price__c, - Product__r.Name, - Product__r.MSRP__c, - Product__r.Picture_URL__c - FROM Order_Item__c - WHERE Order__c = :orderId - WITH SECURITY_ENFORCED - ]; - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/OrderController.cls-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/classes/OrderController.cls-meta.xml deleted file mode 100644 index 2e4da8f1c..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/OrderController.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 52.0 - Active - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/PagedResult.cls b/test/nuts/ebikes-lwc/force-app/main/default/classes/PagedResult.cls deleted file mode 100644 index 182bdcf91..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/PagedResult.cls +++ /dev/null @@ -1,13 +0,0 @@ -public with sharing class PagedResult { - @AuraEnabled - public Integer pageSize { get; set; } - - @AuraEnabled - public Integer pageNumber { get; set; } - - @AuraEnabled - public Integer totalItemCount { get; set; } - - @AuraEnabled - public Object[] records { get; set; } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/PagedResult.cls-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/classes/PagedResult.cls-meta.xml deleted file mode 100644 index 1fedead5b..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/PagedResult.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 52.0 - Active - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductController.cls b/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductController.cls deleted file mode 100644 index 083d156f4..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductController.cls +++ /dev/null @@ -1,84 +0,0 @@ -public with sharing class ProductController { - static Integer PAGE_SIZE = 9; - - public class Filters { - @AuraEnabled - public String searchKey { get; set; } - @AuraEnabled - public Decimal maxPrice { get; set; } - @AuraEnabled - public String[] categories { get; set; } - @AuraEnabled - public String[] materials { get; set; } - @AuraEnabled - public String[] levels { get; set; } - } - - @AuraEnabled(Cacheable=true) - public static PagedResult getProducts(Filters filters, Integer pageNumber) { - String key, whereClause = ''; - Decimal maxPrice; - String[] categories, materials, levels, criteria = new List{}; - if (filters != null) { - maxPrice = filters.maxPrice; - materials = filters.materials; - levels = filters.levels; - if (!String.isEmpty(filters.searchKey)) { - key = '%' + filters.searchKey + '%'; - criteria.add('Name LIKE :key'); - } - if (filters.maxPrice >= 0) { - maxPrice = filters.maxPrice; - criteria.add('MSRP__c <= :maxPrice'); - } - if (filters.categories != null) { - categories = filters.categories; - criteria.add('Category__c IN :categories'); - } - if (filters.levels != null) { - levels = filters.levels; - criteria.add('Level__c IN :levels'); - } - if (filters.materials != null) { - materials = filters.materials; - criteria.add('Material__c IN :materials'); - } - if (criteria.size() > 0) { - whereClause = 'WHERE ' + String.join(criteria, ' AND '); - } - } - Integer pageSize = ProductController.PAGE_SIZE; - Integer offset = (pageNumber - 1) * pageSize; - PagedResult result = new PagedResult(); - result.pageSize = pageSize; - result.pageNumber = pageNumber; - result.totalItemCount = Database.countQuery( - 'SELECT count() FROM Product__c ' + whereClause - ); - result.records = Database.query( - 'SELECT Id, Name, MSRP__c, Description__c, Category__c, Level__c, Picture_URL__c, Material__c FROM Product__c ' + - whereClause + - ' WITH SECURITY_ENFORCED' + - ' ORDER BY Name LIMIT :pageSize OFFSET :offset' - ); - return result; - } - - @AuraEnabled(Cacheable=true) - public static Product__c[] getSimilarProducts(Id productId, Id familyId) { - return [ - SELECT - Id, - Name, - MSRP__c, - Description__c, - Category__c, - Level__c, - Picture_URL__c, - Material__c - FROM Product__c - WHERE Product_Family__c = :familyId AND Id != :productId - WITH SECURITY_ENFORCED - ]; - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductController.cls-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductController.cls-meta.xml deleted file mode 100644 index e9f2f8698..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductController.cls-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 52.0 - Active - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductRecordInfoController.cls b/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductRecordInfoController.cls deleted file mode 100644 index 78904b430..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductRecordInfoController.cls +++ /dev/null @@ -1,31 +0,0 @@ -public with sharing class ProductRecordInfoController { - @AuraEnabled(Cacheable=true) - public static List getRecordInfo(String productOrFamilyName) { - List recordInfo = new List(); - - List cProductList = [ - SELECT ID - FROM Product__c - WHERE NAME = :productOrFamilyName - WITH SECURITY_ENFORCED - ]; - if (cProductList.size() > 0) { - recordInfo.add(cProductList[0].ID); - recordInfo.add('Product__c'); - return recordInfo; - } - - List cProductFamilyList = [ - SELECT ID - FROM Product_Family__c - WHERE NAME = :productOrFamilyName - WITH SECURITY_ENFORCED - ]; - if (cProductFamilyList.size() > 0) { - recordInfo.add(cProductFamilyList[0].ID); - recordInfo.add('Product_Family__c'); - return recordInfo; - } - return null; - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductRecordInfoController.cls-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductRecordInfoController.cls-meta.xml deleted file mode 100644 index 091f7b03c..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/ProductRecordInfoController.cls-meta.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - 52.0 - Active - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/TestOrderController.cls b/test/nuts/ebikes-lwc/force-app/main/default/classes/TestOrderController.cls deleted file mode 100644 index 28ead55bf..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/TestOrderController.cls +++ /dev/null @@ -1,29 +0,0 @@ -@isTest -public class TestOrderController { - @testSetup - static void setup() { - Account acc = new Account(Name = 'Sample Account'); - insert acc; - - Order__c order = new Order__c(Account__c = acc.Id); - insert order; - - Product__c p = new Product__c(Name = 'Sample Product'); - insert p; - - Order_Item__c orderItem = new Order_Item__c( - Order__c = order.Id, - Product__c = p.Id - ); - insert orderItem; - } - - @isTest - static void testGetOrderItems() { - Order__c testOrder = [SELECT Id FROM Order__c]; - List orderItems = OrderController.getOrderItems( - testOrder.Id - ); - System.assertEquals(orderItems.size(), 1); - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/TestOrderController.cls-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/classes/TestOrderController.cls-meta.xml deleted file mode 100644 index b9245a906..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/TestOrderController.cls-meta.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - 52.0 - Active - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/TestProductController.cls b/test/nuts/ebikes-lwc/force-app/main/default/classes/TestProductController.cls deleted file mode 100644 index 7a7c0afdd..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/TestProductController.cls +++ /dev/null @@ -1,58 +0,0 @@ -@isTest -public class TestProductController { - @testSetup - static void createProducts() { - List products = new List(); - - products.add( - new Product__c( - Name = 'Sample Bike 1', - MSRP__c = 1000, - Category__c = 'Mountain', - Level__c = 'Beginner', - Material__c = 'Carbon' - ) - ); - - products.add( - new Product__c( - Name = 'Sample Bike 2', - MSRP__c = 1200, - Category__c = 'Mountain', - Level__c = 'Beginner', - Material__c = 'Carbon' - ) - ); - - insert products; - } - - @isTest - static void testGetProducts() { - ProductController.Filters filters = new ProductController.Filters(); - filters.searchKey = 'Sample'; - filters.maxPrice = 2000; - filters.categories = new List{ 'Mountain' }; - filters.levels = new List{ 'Beginner' }; - filters.materials = new List{ 'Carbon' }; - PagedResult result = ProductController.getProducts(filters, 1); - System.assertEquals(result.records.size(), 2); - } - - @isTest - static void testGetSimilarProducts() { - ProductController.Filters filters = new ProductController.Filters(); - filters.searchKey = 'Sample'; - filters.maxPrice = 2000; - filters.categories = new List{ 'Mountain' }; - filters.levels = new List{ 'Beginner' }; - filters.materials = new List{ 'Carbon' }; - PagedResult result = ProductController.getProducts(filters, 1); - Product__c productToCompare = (Product__c) result.records[0]; - Product__c[] products = ProductController.getSimilarProducts( - productToCompare.Id, - null - ); - System.assertEquals(products.size(), 1); - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/classes/TestProductController.cls-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/classes/TestProductController.cls-meta.xml deleted file mode 100644 index ed18b3146..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/classes/TestProductController.cls-meta.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - 52.0 - Active - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/contentassets/ebikeslogo.asset b/test/nuts/ebikes-lwc/force-app/main/default/contentassets/ebikeslogo.asset deleted file mode 100644 index 48ab4110b..000000000 Binary files a/test/nuts/ebikes-lwc/force-app/main/default/contentassets/ebikeslogo.asset and /dev/null differ diff --git a/test/nuts/ebikes-lwc/force-app/main/default/contentassets/ebikeslogo.asset-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/contentassets/ebikeslogo.asset-meta.xml deleted file mode 100644 index f1331dfde..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/contentassets/ebikeslogo.asset-meta.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - false - en_US - ebikeslogo - E-Bikes - - - VIEWER - E-Bikes - - - INFERRED - true - sfdc_asset_company_assets - - - - - 1 - ebikes-logo.png - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/contentassets/logo.asset b/test/nuts/ebikes-lwc/force-app/main/default/contentassets/logo.asset deleted file mode 100644 index 8c070a41e..000000000 Binary files a/test/nuts/ebikes-lwc/force-app/main/default/contentassets/logo.asset and /dev/null differ diff --git a/test/nuts/ebikes-lwc/force-app/main/default/contentassets/logo.asset-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/contentassets/logo.asset-meta.xml deleted file mode 100644 index 33db89b9e..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/contentassets/logo.asset-meta.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - en_US - logo - - - VIEWER - - - - - 1 - logo.png - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/cspTrustedSites/s3_us_west_1_amazonaws_com.cspTrustedSite-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/cspTrustedSites/s3_us_west_1_amazonaws_com.cspTrustedSite-meta.xml deleted file mode 100644 index b54a91ab1..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/cspTrustedSites/s3_us_west_1_amazonaws_com.cspTrustedSite-meta.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - Communities - s3_us_west_1_amazonaws_com Trusted Site Added Via Community Builder - https://s3-us-west-1.amazonaws.com - true - true - true - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1.site-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1.site-meta.xml deleted file mode 100644 index 7e21833e5..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1.site-meta.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - ChatterNetworkPicasso - ebikes/s - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/brandingSets/jepson.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/brandingSets/jepson.json deleted file mode 100644 index 42c5914d4..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/brandingSets/jepson.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "definitionName": "jepson:branding-jepson", - "id": "26ab9e87-e30e-419f-b5b6-e054218fcee7", - "label": "Jepson", - "type": "brandingSet", - "values": { - "ActionColor": "rgb(57, 75, 133)", - "BorderColor": "#D4D4D4", - "CardBackgroundColor": "rgba(255, 255, 255, 0)", - "CompanyLogo": "/file-asset/ebikeslogo?v=1&height=300&width=300", - "DetailTextColor": "rgba(0, 0, 0, 0.6)", - "ErrorFontColor": "#ff9e9e", - "HeaderFonts": "Montserrat", - "LinkColor": "#111111", - "LoginBackgroundColor": "#F4F4F4", - "LoginBackgroundImage": "../../../../sfsites/picasso/core/external/salesforceIdentity/images/background.jpg?v=1", - "OverlayTextColor": "rgb(255, 255, 255)", - "PageBackgroundColor": "#FFFFFF", - "PrimaryFont": "Lato", - "TextColor": "rgb(0, 0, 0)", - "TextTransformStyle": "none", - "_ActionColorDarker": "#2a3761", - "_ActionColorTrans": "rgba(57, 75, 133, 0.9)", - "_HoverColor": "rgba(57, 75, 133, 0.05)", - "_LinkColorDarker": "#000000", - "_OverlayTextColorShadow": "#000" - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/eBikes.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/eBikes.json deleted file mode 100644 index 7ffe3e322..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/eBikes.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "forgotPasswordRouteId": "4d11ba48-ae98-4f79-be18-773b4a58bc43", - "isAvailableToGuests": true, - "isFilteredComponentsView": false, - "isProgressiveRenderingEnabled": false, - "loginAppPageId": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "mainAppPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "preferredDomain": "none", - "selfRegistrationRouteId": "f6e8a5f5-92bf-4798-908a-b210093187c5", - "type": "site" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/languages.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/languages.json deleted file mode 100644 index ef951ddcf..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/languages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "defaultCode": "en_US", - "defaultLabel": "English (US)", - "id": "e7c0a94e-a8fb-4ab7-ad4e-1c7ceb9060bb", - "type": "languageContainer" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/loginAppPage.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/loginAppPage.json deleted file mode 100644 index e06bba6da..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/loginAppPage.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "cmsSettings": {}, - "id": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "label": "login", - "templateName": "Login Template", - "type": "appPage" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/mainAppPage.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/mainAppPage.json deleted file mode 100644 index 668d1bf68..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/config/mainAppPage.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "cmsSettings": {}, - "currentThemeId": "1de30f59-39c2-4185-8b07-e304750c2009", - "headMarkup": "", - "id": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "isRelaxedCSPLevel": false, - "label": "main", - "templateName": "Starter Template", - "type": "appPage" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/checkPassword.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/checkPassword.json deleted file mode 100644 index 1e1ef7ee3..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/checkPassword.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "activeViewId": "ab661696-53be-4597-b29f-7410c59486fa", - "appPageId": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "configurationTags": [], - "id": "dd3385f8-c3f7-4e2a-867a-61b0bd794282", - "label": "Check Password", - "routeType": "check-password", - "type": "route", - "urlPrefix": "CheckPasswordResetEmail" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/createCase.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/createCase.json deleted file mode 100644 index 14ec720cd..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/createCase.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "4febe178-894b-4426-8345-87a24eb8161d", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "806ddd2e-4c9e-4173-9887-3d86f1c22a64", - "label": "Create Case", - "pageAccess": "UseParent", - "routeType": "custom-create-case", - "type": "route", - "urlPrefix": "create-case" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/createRecord.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/createRecord.json deleted file mode 100644 index d44ed044d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/createRecord.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "activeViewId": "0832e8af-7900-4144-84cf-0d09812e25a9", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "3b095910-c486-4fdf-8105-f9dccb711864", - "label": "Create Record", - "routeType": "createrecord", - "type": "route", - "urlPrefix": "createrecord" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/error.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/error.json deleted file mode 100644 index ba0a0118d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/error.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "05bb79be-31b4-4fbf-82b9-46351381af7a", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "dc3897e1-7d5c-43e8-bc95-facfe437bd58", - "label": "Error", - "pageAccess": "UseParent", - "routeType": "error", - "type": "route", - "urlPrefix": "error" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/forgotPassword.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/forgotPassword.json deleted file mode 100644 index e320730c4..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/forgotPassword.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "activeViewId": "a39993c0-0c85-4ab2-b6a4-9d476532c627", - "appPageId": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "configurationTags": [], - "id": "4d11ba48-ae98-4f79-be18-773b4a58bc43", - "label": "Forgot Password", - "routeType": "forgot-password", - "type": "route", - "urlPrefix": "ForgotPassword" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/home.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/home.json deleted file mode 100644 index 4ef35880d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/home.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "08b8b3ba-a99c-4e87-88a9-e3178b81eb9f", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "0a2f46d6-852c-43f6-918b-dcf3cd3c554e", - "label": "Home", - "pageAccess": "Public", - "routeType": "home", - "type": "route", - "urlPrefix": "" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/login.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/login.json deleted file mode 100644 index 1caa6d8f5..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/login.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "activeViewId": "e6e40fca-b8df-44af-88e7-5a9096ff0dc7", - "appPageId": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "configurationTags": [], - "id": "5bf6d3f2-f54a-46ef-922e-21dc8534e68f", - "label": "Login", - "routeType": "login-home", - "type": "route", - "urlPrefix": "" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/loginError.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/loginError.json deleted file mode 100644 index adffd839f..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/loginError.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "activeViewId": "dec3d4ed-0782-494b-9242-94dafc6cba9a", - "appPageId": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "configurationTags": [], - "id": "a25f6d5f-e959-4942-968a-1c56d489f1fb", - "label": "Login Error", - "routeType": "login-error", - "type": "route", - "urlPrefix": "error" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productDetail.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productDetail.json deleted file mode 100644 index 84bc22b1a..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productDetail.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "ac8fec2e-cdb0-4d1f-b114-7052cd201195", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "ee4ca899-d9e4-4054-999d-2604c74b1320", - "label": "Product Detail", - "objectApiName": "Product__c", - "routeType": "detail-a03", - "type": "route", - "urlPrefix": "product" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productExplorer.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productExplorer.json deleted file mode 100644 index 2c69b3c8b..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productExplorer.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "3f05e628-072b-4e52-b235-ca04100be399", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "8a0ce10b-80be-4463-8a0b-81bf50a70be3", - "label": "Product Explorer", - "pageAccess": "UseParent", - "routeType": "custom-product-explorer", - "type": "route", - "urlPrefix": "product-explorer" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productFamilyDetail.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productFamilyDetail.json deleted file mode 100644 index 068cc1c50..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productFamilyDetail.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "c177692a-740d-4c05-8dce-e725b859f8a1", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "8f06df84-e849-481e-8113-863a18531f2c", - "label": "Product Family Detail", - "objectApiName": "Product_Family__c", - "routeType": "detail-a02", - "type": "route", - "urlPrefix": "product-family" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productFamilyList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productFamilyList.json deleted file mode 100644 index 9d95dff61..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productFamilyList.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "33b22787-79f5-484a-a68d-336253ee7c9d", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "0c98ee0e-451e-40cd-ae0c-703c8bfa5409", - "label": "Product Family List", - "objectApiName": "Product_Family__c", - "routeType": "list-a02", - "type": "route", - "urlPrefix": "product-family" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productFamilyRelatedList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productFamilyRelatedList.json deleted file mode 100644 index 4fbc2a177..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productFamilyRelatedList.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "eb60ff2f-bca3-4cc7-befe-74a5cc28d67f", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "3735ee76-cd70-4ebb-bf1d-3d0d3193d8de", - "label": "Product Family Related List", - "objectApiName": "Product_Family__c", - "routeType": "relatedlist-a02", - "type": "route", - "urlPrefix": "product-family" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productList.json deleted file mode 100644 index 12c001572..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productList.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "64ffb57c-d489-405b-8ef0-9e305b69108a", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "ec3c57ca-598e-42e4-9624-11534b0fa9a9", - "label": "Product List", - "objectApiName": "Product__c", - "routeType": "list-a03", - "type": "route", - "urlPrefix": "product" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productRelatedList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productRelatedList.json deleted file mode 100644 index 5847ad862..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/productRelatedList.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "e264ab42-0382-4aa8-bb39-56df8e6f0aaa", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "af36f75a-4c29-489a-9aee-e147e19661e5", - "label": "Product Related List", - "objectApiName": "Product__c", - "routeType": "relatedlist-a03", - "type": "route", - "urlPrefix": "product" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/recordDetail.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/recordDetail.json deleted file mode 100644 index 29b07aa46..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/recordDetail.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "activeViewId": "af3a4208-3892-4c64-a7da-4d89dbf73bcb", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "f2f10127-b247-43df-b016-91bd62bc4c09", - "label": "Record Detail", - "routeType": "detail", - "type": "route", - "urlPrefix": "detail" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/recordList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/recordList.json deleted file mode 100644 index 7079fc5a3..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/recordList.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "a3538c57-83b2-4701-9517-a5f85ef7f86c", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "60623e7d-210a-4263-9d0f-08289b2ecb29", - "label": "Record List", - "pageAccess": "UseParent", - "routeType": "list", - "type": "route", - "urlPrefix": "recordlist" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/register.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/register.json deleted file mode 100644 index d6900e63c..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/register.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "activeViewId": "c20b51fb-94a9-46e0-a944-c0511e0957cf", - "appPageId": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "configurationTags": [], - "id": "f6e8a5f5-92bf-4798-908a-b210093187c5", - "label": "Register", - "routeType": "self-register", - "type": "route", - "urlPrefix": "SelfRegister" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/relatedRecordList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/relatedRecordList.json deleted file mode 100644 index 22f6d7cc5..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/relatedRecordList.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "612a81a7-50e3-46bf-b5cd-bf7bfd2ba62a", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "24dd466b-ece1-4383-8113-807fe64a0861", - "label": "Related Record List", - "pageAccess": "UseParent", - "routeType": "relatedlist", - "type": "route", - "urlPrefix": "relatedlist" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/search.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/search.json deleted file mode 100644 index ed997befc..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/search.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "activeViewId": "7067e1f5-ea41-46a0-8a85-9b528ac7ca67", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": [], - "id": "42b99c23-3e80-4705-8863-79027b6b031d", - "label": "Search", - "pageAccess": "UseParent", - "routeType": "global-search", - "type": "route", - "urlPrefix": "global-search" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/serviceNotAvailable.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/serviceNotAvailable.json deleted file mode 100644 index 3d37a7659..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/routes/serviceNotAvailable.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "activeViewId": "051e5cc7-26ba-4366-a9f6-a0067e0d96aa", - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "configurationTags": ["allow-in-static-site"], - "id": "5bc1ef73-1ab6-47c6-be70-e22710335d7a", - "label": "Service Not Available", - "routeType": "service-not-available", - "type": "route", - "urlPrefix": "service-not-available" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/themes/jepson.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/themes/jepson.json deleted file mode 100644 index 7ac9bd1e8..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/themes/jepson.json +++ /dev/null @@ -1,305 +0,0 @@ -{ - "activeBrandingSetId": "26ab9e87-e30e-419f-b5b6-e054218fcee7", - "customCSS": "/* ExperienceBundle bug fix: nav menu style randomly switches theme and ends up white */\n.themeNav .forceCommunityThemeNav .mainNavItem a.linkBtn,.themeNav .forceCommunityThemeNav .mainNavItem a.linkBtn:hover {\n color: #000000 !important;\n}\n.themeNav .forceCommunityThemeNav .mainNavItem a.linkBtn.comm-navigation__top-level-item-link--active {\n\tborder-bottom: 2px solid rgb(57, 75, 133) !important; \n}\n/* ExperienceBundle bug fix: home page width not saved */\n.comm-page-home .body.isPageWidthFixed-true {\n width: 100% !important;\n}\n/* Remove whitespace around regions and components */\n.contentRegion, .comm-content-header {\n padding: 0 !important;\n}\n.ui-widget {\n margin: 0 !important;\n}", - "developerName": "jepson", - "id": "1de30f59-39c2-4185-8b07-e304750c2009", - "label": "Jepson", - "layouts": { - "Home": "ef7d55e9-d400-400c-b895-49ccc916c52e", - "Inner": "1e7d39c7-bfc8-441a-a3ac-bdd8058dba6f", - "Login": "10fb592c-ced0-44cf-bf8e-7bbc5327e5f3", - "ServiceNotAvailable": "6102e046-b7c1-4fb9-a330-27971d42c36a" - }, - "type": "theme", - "views": [ - { - "componentAttributes": { - "fixedPageWidth": 1440, - "headerBgColor": "rgba(0, 0, 0, 0)", - "isHeaderPinned": false, - "isHeroUnderHeader": false, - "isPageWidthFixed": false, - "showHeader": false, - "showHero": false - }, - "componentName": "siteforce:themeLayoutStarter", - "id": "6102e046-b7c1-4fb9-a330-27971d42c36a", - "label": "ServiceNotAvailable", - "regions": [ - { - "id": "fbf1f5f0-b812-42a3-9a31-47fa9efce267", - "regionName": "themeHeader", - "type": "region" - }, - { - "id": "0b766870-3c08-4268-b431-a427d8ceae73", - "regionName": "themeFooter", - "type": "region" - } - ], - "type": "view" - }, - { - "componentAttributes": {}, - "componentName": "salesforceIdentity:loginBody2", - "id": "10fb592c-ced0-44cf-bf8e-7bbc5327e5f3", - "label": "Login", - "regions": [ - { - "id": "b16d9c03-5c2d-4cee-ada3-e7e21ac39603", - "regionName": "header", - "type": "region" - }, - { - "id": "26248f43-19d2-441b-8b7e-4e8998b692df", - "regionName": "content", - "type": "region" - }, - { - "id": "5a327d68-7417-44b9-8a93-5875f4944260", - "regionName": "footer", - "type": "region" - } - ], - "type": "view" - }, - { - "componentAttributes": { - "fixedPageWidth": 1440, - "headerBgColor": "rgba(255, 255, 255, 0.8)", - "isHeaderPinned": false, - "isHeroUnderHeader": false, - "isPageWidthFixed": true, - "showHeader": true, - "showHero": false - }, - "componentName": "siteforce:themeLayoutStarter", - "id": "1e7d39c7-bfc8-441a-a3ac-bdd8058dba6f", - "label": "Default", - "regions": [ - { - "components": [ - { - "componentAttributes": { - "background": "background: #FFFFFF", - "backgroundOverlayColor": "rgba(0, 0, 0, 0.3)", - "borderBottomColor": "rgba(0, 0, 0, 0.5)", - "centerAlignLogo": false, - "collapseNavMenu": false, - "containHeader": true, - "containHeaderWidth": 1440, - "dropdownBackgroundColor": "#FFFFFF", - "dropdownBackgroundHoverColor": "", - "dropdownBorderColor": "#F0F0F0", - "dropdownTextColor": "", - "dropdownTextHoverColor": "", - "headerHeight": 16, - "linkActiveBorderColor": "", - "linkColor": "rgba(0, 0, 0, 0.8)", - "linkHoverColor": "rgba(0, 0, 0, 0.7)", - "linkTextShadowColor": "rgba(255, 255, 255, 0)", - "logoWidth": 50, - "searchStyle": "expanded", - "showAppLauncher": false, - "showNavMenuOnLeft": true, - "showNotifications": true, - "showProfileMenu": true, - "showSearch": false - }, - "componentName": "forceCommunity:themeHeaderCompact", - "id": "ea937fc5-7df5-40e4-b332-66e90bf16a8a", - "regions": [ - { - "components": [ - { - "componentAttributes": { - "buttonBackgroundColor": "", - "buttonBackgroundHoverColor": "", - "buttonBorderColor": "rgba(0, 0, 0, 0)", - "buttonBorderRadius": 15, - "buttonText": "Log in", - "buttonTextColor": "", - "buttonTextHoverColor": "", - "menuStyleSettings": "{\"selectedMenuStyleSetting\":\"iconOnly\",\"selectedIconSetting\":\"userAvatar\",\"includeCompanyName\":false,\"selectedTextOrientationSetting\":\"right\"}" - }, - "componentName": "forceCommunity:customizableUserProfileMenu", - "id": "bd98d2ad-538d-4d38-90ed-be99913c1dfb", - "renditionMap": {}, - "type": "component" - } - ], - "id": "64d6b330-3f34-44bb-9636-539e86f2afd2", - "regionName": "themeHeaderProfileMenu", - "type": "region" - }, - { - "id": "43c41dd8-005c-4544-9b22-b477986a468c", - "regionName": "search", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "navAlignment": "left", - "navItemThreshold": 6, - "navigationMenuEditorRefresh": "Default_Navigation" - }, - "componentName": "forceCommunity:themeNav", - "id": "1dccf062-078a-4fde-a185-1c6b822db8b0", - "renditionMap": {}, - "type": "component" - } - ], - "id": "3eab6078-168d-4843-903c-68d2a501107f", - "regionName": "nav", - "type": "region" - }, - { - "id": "ba649ed0-7f7f-4cd7-9a9e-33c42f4acea3", - "regionName": "cartIcon", - "type": "region" - } - ], - "renditionMap": {}, - "type": "component" - } - ], - "id": "c2efc896-88ec-4b2b-9b45-71c9fbd1aa5f", - "regionName": "themeHeader", - "type": "region" - }, - { - "id": "f4a43496-573a-4e15-b683-9fe6a4f6f6f5", - "regionName": "themeHero", - "type": "region" - }, - { - "id": "fe6857c9-2522-4403-bef3-a5af111dc070", - "regionName": "themeFooter", - "type": "region" - } - ], - "type": "view" - }, - { - "componentAttributes": { - "fixedPageWidth": 1440, - "headerBgColor": "rgba(255, 255, 255, 0.8)", - "isHeaderPinned": false, - "isHeroUnderHeader": false, - "isPageWidthFixed": true, - "showHeader": true, - "showHero": true - }, - "componentName": "siteforce:themeLayoutStarter", - "id": "ef7d55e9-d400-400c-b895-49ccc916c52e", - "label": "Home", - "regions": [ - { - "components": [ - { - "componentAttributes": { - "background": "background: rgb(255,255,255)", - "backgroundOverlayColor": "rgba(0, 0, 0, 0.3)", - "borderBottomColor": "rgba(0, 0, 0, 0.5)", - "centerAlignLogo": false, - "collapseNavMenu": false, - "containHeader": true, - "containHeaderWidth": 1440, - "dropdownBackgroundColor": "#FFFFFF", - "dropdownBackgroundHoverColor": "", - "dropdownBorderColor": "#F0F0F0", - "dropdownTextColor": "", - "dropdownTextHoverColor": "", - "headerHeight": 16, - "linkActiveBorderColor": "", - "linkColor": "rgba(0, 0, 0, 0.8)", - "linkHoverColor": "rgba(0, 0, 0, 0.7)", - "linkTextShadowColor": "rgba(255, 255, 255, 0)", - "logoWidth": 50, - "searchStyle": "expanded", - "showAppLauncher": false, - "showNavMenuOnLeft": true, - "showNotifications": true, - "showProfileMenu": true, - "showSearch": false - }, - "componentName": "forceCommunity:themeHeaderCompact", - "id": "48a72a08-8a06-4067-9240-5eb5b287f69b", - "regions": [ - { - "components": [ - { - "componentAttributes": { - "buttonBackgroundColor": "", - "buttonBackgroundHoverColor": "", - "buttonBorderColor": "rgba(0, 0, 0, 0)", - "buttonBorderRadius": 15, - "buttonText": "Log in", - "buttonTextColor": "", - "buttonTextHoverColor": "", - "menuStyleSettings": "{\"selectedMenuStyleSetting\":\"iconOnly\",\"selectedIconSetting\":\"userAvatar\",\"includeCompanyName\":false,\"selectedTextOrientationSetting\":\"right\"}" - }, - "componentName": "forceCommunity:customizableUserProfileMenu", - "id": "67f1ffc7-d66c-44a1-a020-df2c3d80c323", - "renditionMap": {}, - "type": "component" - } - ], - "id": "847ef128-bff8-40ba-9028-ec7e2637734a", - "regionName": "themeHeaderProfileMenu", - "type": "region" - }, - { - "id": "0d38aff7-c98b-416e-b230-154abc1ef4f4", - "regionName": "search", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "navAlignment": "left", - "navItemThreshold": 10, - "navigationMenuEditorRefresh": "Default_Navigation" - }, - "componentName": "forceCommunity:themeNav", - "id": "f78b9665-bf73-45c3-b5e1-8bf378c0c8d4", - "renditionMap": {}, - "type": "component" - } - ], - "id": "f57a6d45-d587-49d1-a4bb-545306e4d924", - "regionName": "nav", - "type": "region" - }, - { - "id": "f06227c1-23ae-46a0-af3f-2a31c794c212", - "regionName": "cartIcon", - "type": "region" - } - ], - "renditionMap": {}, - "type": "component" - } - ], - "id": "21c0321b-4723-45c0-b381-af8ad66cb140", - "regionName": "themeHeader", - "type": "region" - }, - { - "id": "f65a58d0-7419-4a92-b21f-77b07d52cb50", - "regionName": "themeHero", - "type": "region" - }, - { - "id": "8fcff882-f166-4514-9dbd-b6b616055ca2", - "regionName": "themeFooter", - "type": "region" - } - ], - "type": "view" - } - ] -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/checkPassword.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/checkPassword.json deleted file mode 100644 index 5361b709d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/checkPassword.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "appPageId": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "componentName": "siteforce:sldsOneColLayout", - "id": "ab661696-53be-4597-b29f-7410c59486fa", - "label": "Check Password", - "regions": [ - { - "components": [ - { - "componentAttributes": { - "richTextValue": "
NOW, CHECK YOUR EMAIL
" - }, - "componentName": "forceCommunity:richTextInline", - "id": "c15a7cd6-fcbe-462e-add6-2fc76dcfd896", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "richTextValue": "
Check the email account associated with your user name for instructions on resetting your password. Remember to look in your spam folder, where automated messages sometimes filter. If you still can't log in, contact your administrator.
" - }, - "componentName": "forceCommunity:richTextInline", - "id": "b94c794b-a651-404d-8df2-748d1020769e", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "richTextValue": "" - }, - "componentName": "forceCommunity:richTextInline", - "id": "d2daba84-0d7d-43ca-8941-f06e0bc309a4", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "1c5fa798-984b-4cbd-a1cf-a7bdae973ae9", - "regionName": "content", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "Check Password" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "a05d9a0e-027a-4a2a-8850-2b68386e1a60", - "renditionMap": {}, - "type": "component" - } - ], - "id": "0982c286-f771-4137-9fc4-783ecfc04fe8", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Login", - "type": "view", - "viewType": "check-password" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/createCase.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/createCase.json deleted file mode 100644 index eaf9a6870..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/createCase.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "4febe178-894b-4426-8345-87a24eb8161d", - "label": "Create Case", - "regions": [ - { - "id": "bf02a85f-7edf-4f59-a1dc-106cd9983a47", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": {}, - "componentName": "c:createCase", - "id": "01586183-3206-48ec-910b-18b2021d89e6", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "8ec670a5-a20c-4db1-b879-f081f2c3e22b", - "regionName": "content", - "type": "region" - }, - { - "id": "31fe2e0b-2c88-487f-a0a5-a4151c56c55a", - "regionName": "sidebar", - "type": "region" - }, - { - "id": "73d6b1fa-c522-49a4-8338-33c08a632003", - "regionName": "footer", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "Create Case" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "8cd4a834-96e5-4f25-af68-e1ece1accc88", - "renditionMap": {}, - "type": "component" - } - ], - "id": "d24e3a84-5dee-4788-9df7-ba7264bf3e03", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "custom-create-case" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/createRecord.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/createRecord.json deleted file mode 100644 index ebc4a105d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/createRecord.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "0832e8af-7900-4144-84cf-0d09812e25a9", - "label": "Create Record", - "regions": [ - { - "id": "53c5c8bc-234a-43cc-8a20-83f69edf50e4", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "actionApiName": "{!actionApiName}" - }, - "componentName": "forceCommunity:createRecordForm", - "id": "e87f211d-b03d-46ea-acf1-767764c1be3e", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "54d81048-9d07-42a0-85c1-db92bc3a33ea", - "regionName": "content", - "type": "region" - }, - { - "id": "d6468f2f-fc9d-41b7-9aa3-87869dabdcca", - "regionName": "footer", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "createrecord" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/error.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/error.json deleted file mode 100644 index 1df64f4ba..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/error.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "05bb79be-31b4-4fbf-82b9-46351381af7a", - "label": "Error", - "regions": [ - { - "id": "4bc436a4-b3ec-465c-bc2a-a9bae6891c93", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "richTextValue": "
Invalid Page
" - }, - "componentName": "forceCommunity:richTextInline", - "id": "ce095ed4-2744-491e-b3f7-5c40a057a075", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "be5bc6cd-8794-4705-8117-159aabf3249e", - "regionName": "content", - "type": "region" - }, - { - "id": "e12f836e-06e7-4781-952f-0ab8992e8795", - "regionName": "footer", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "Error" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "75c00f5d-b632-4a58-9581-a7beb170594e", - "renditionMap": {}, - "type": "component" - } - ], - "id": "97a196c8-f21a-41f4-9742-f7422b0b2b41", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "error" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/forgotPassword.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/forgotPassword.json deleted file mode 100644 index 2b48100d6..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/forgotPassword.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "appPageId": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "componentName": "siteforce:sldsOneColLayout", - "id": "a39993c0-0c85-4ab2-b6a4-9d476532c627", - "label": "Forgot Password", - "regions": [ - { - "components": [ - { - "componentAttributes": { - "richTextValue": "
PASSWORD RESET
" - }, - "componentName": "forceCommunity:richTextInline", - "id": "61852324-b298-4692-9357-70b2a426545a", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "richTextValue": "
To reset your password, we'll need your username.
We'll send password reset instructions to the email address associated with your account.
" - }, - "componentName": "forceCommunity:richTextInline", - "id": "dab54964-d983-4346-8520-cfebbf98d3ba", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "checkEmailUrl": "./CheckPasswordResetEmail", - "submitButtonLabel": "Reset Password", - "usernameLabel": "Username" - }, - "componentName": "salesforceIdentity:forgotPassword2", - "id": "e5875695-bafe-45de-ba13-3904eb90c527", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "richTextValue": "" - }, - "componentName": "forceCommunity:richTextInline", - "id": "615a8145-eab3-435f-8dfa-5335959de764", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "e3dff669-cee6-41c1-a279-59caf0c2e4a9", - "regionName": "content", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "Forgot Password" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "f6d505cb-341c-49ad-b64d-2c6c6120abf1", - "renditionMap": {}, - "type": "component" - } - ], - "id": "10aba98b-4ab1-4b88-946a-15c22bf2aa58", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Login", - "type": "view", - "viewType": "forgot-password" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/home.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/home.json deleted file mode 100644 index 5a045b248..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/home.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "08b8b3ba-a99c-4e87-88a9-e3178b81eb9f", - "label": "Home", - "regions": [ - { - "id": "174fd8f6-046c-4436-adff-f5d56aad729a", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "buttonClickProductOrFamilyName": "Dynamo X2", - "buttonText": "Explore More", - "heroDetailsPosition": "left", - "imgOrVideo": "Video", - "internalResource": false, - "opacity": 5, - "overlay": false, - "resourceUrl": "https://s3-us-west-1.amazonaws.com/sfdc-demo/bikes/ebikes.mp4", - "slogan": "Conquer The Impossible", - "title": "Dynamo X2" - }, - "componentName": "c:hero", - "id": "841b3c9f-c347-48d4-b977-9a9e21d853eb", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "buttonClickProductOrFamilyName": "Electra", - "buttonText": "See Electra Bikes", - "heroDetailsPosition": "right", - "imgOrVideo": "Image", - "internalResource": true, - "opacity": 5, - "overlay": true, - "resourceUrl": "/CyclingGrass.jpg", - "slogan": "Ride With Power", - "title": "Electra Series" - }, - "componentName": "c:hero", - "id": "5c2f9bbf-fe10-4691-abaf-852a760dc838", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "3de90bfd-a82e-4ea4-b5e3-1fe466c2685b", - "regionName": "content", - "type": "region" - }, - { - "id": "5675183e-90a4-4319-9a68-ec255416a666", - "regionName": "footer", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "Home" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "79f5f40c-b935-4f89-8cab-3d9733d6e846", - "renditionMap": {}, - "type": "component" - } - ], - "id": "f909a255-f36d-46a7-b813-677c6a651e13", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Home", - "type": "view", - "viewType": "home" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/login.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/login.json deleted file mode 100644 index 7173b3fcf..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/login.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "appPageId": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "componentName": "siteforce:sldsOneColLayout", - "id": "e6e40fca-b8df-44af-88e7-5a9096ff0dc7", - "label": "Login", - "regions": [ - { - "components": [ - { - "componentAttributes": {}, - "componentName": "salesforceIdentity:communityLogo2", - "id": "5d7ef429-3287-4af7-a18d-d856e93ed387", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "forgotPasswordLabel": "Forgot your password?", - "forgotPasswordUrl": "/ForgotPassword", - "loginButtonLabel": "Log in", - "passwordLabel": "Password", - "selfRegisterLabel": "Not a member?", - "selfRegisterUrl": "/SelfRegister", - "startUrl": "", - "usernameLabel": "Username" - }, - "componentName": "salesforceIdentity:loginForm2", - "id": "4ad2aef4-e86d-432d-9e7a-101a4075a8d2", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "headerText": "", - "showHeader": false - }, - "componentName": "salesforceIdentity:socialLogin2", - "id": "baaa7380-6e97-4856-9106-6d072efd7712", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "employeeLoginLinkLabel": "Are you an employee? Login here" - }, - "componentName": "salesforceIdentity:employeeLoginLink2", - "id": "f46495ef-21cf-481e-b86a-974a929fb75e", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "3d74bf6e-cd4a-476d-bd36-72f3e9565fad", - "regionName": "content", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "Login" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "f3f3e1c8-69c5-4a36-8109-e022ba96eff7", - "renditionMap": {}, - "type": "component" - } - ], - "id": "ae5fea7a-5b07-46f4-851e-a1b3f947db3e", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Login", - "type": "view", - "viewType": "login-home" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/loginError.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/loginError.json deleted file mode 100644 index c6e7c0864..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/loginError.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "appPageId": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "componentName": "siteforce:sldsOneColLayout", - "id": "dec3d4ed-0782-494b-9242-94dafc6cba9a", - "label": "Login Error", - "regions": [ - { - "id": "a692f1c8-290c-4688-9f82-811a0a8ca3dd", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "richTextValue": "
Invalid Page
" - }, - "componentName": "forceCommunity:richTextInline", - "id": "8901b4bd-728f-45e7-a1f4-62cbe060f63e", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "a2c98131-6d57-49e2-a68f-321cfceaa31e", - "regionName": "content", - "type": "region" - }, - { - "id": "fd193439-4e09-49c6-aec7-a6b4066802e5", - "regionName": "footer", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "Login Error" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "a85d92a0-314a-4ef6-8e9e-79c9adb8d207", - "renditionMap": {}, - "type": "component" - } - ], - "id": "b8d251f0-66cb-4155-ad1e-bf3ae381b2c8", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Login", - "type": "view", - "viewType": "login-error" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productDetail.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productDetail.json deleted file mode 100644 index 215ea3dc5..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productDetail.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "ac8fec2e-cdb0-4d1f-b114-7052cd201195", - "label": "Product Detail", - "regions": [ - { - "id": "258524db-6124-47d2-ba01-e5af77010cc3", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "recordId": "{!recordId}" - }, - "componentName": "forceCommunity:recordHeadline", - "id": "f2629995-5fe2-48ed-9141-11208f236a0a", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "detailsTabLabel": "Details", - "discussionsTabLabel": "Feed", - "recordId": "{!recordId}", - "relatedTabLabel": "Related", - "tab1Type": "details", - "tab2Type": "related", - "tab3Type": "none", - "tab4Type": "none", - "timelineTabLabel": "Activity" - }, - "componentName": "forceCommunity:recordHomeTabs", - "id": "7693d2ed-96ec-4cbc-b514-244d029b4d32", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "e967d756-db7d-4977-b0bf-692b199bf5cb", - "regionName": "content", - "type": "region" - }, - { - "id": "3cafa266-75e7-488d-8bb4-e3e305453efa", - "regionName": "footer", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "{!Record._Object}: {!Record._Title}" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "fd50f6de-5e7a-4fc2-bbb9-2a0106c3ca6c", - "renditionMap": {}, - "type": "component" - } - ], - "id": "d6ba96cf-bf52-4bab-aa18-69feab339e62", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "detail-a03" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productExplorer.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productExplorer.json deleted file mode 100644 index 9e84002e8..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productExplorer.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsThreeCol363Layout", - "id": "3f05e628-072b-4e52-b235-ca04100be399", - "label": "Product Explorer", - "regions": [ - { - "id": "14cf9750-6af1-4e3c-9041-61fb57f0216e", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": {}, - "componentName": "c:productFilter", - "id": "224b69b1-2feb-4009-8382-db5a98abc0b1", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "4013f167-79df-4679-b3e3-8821de46bad1", - "regionName": "sidebar", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "searchBarIsVisible": false, - "tilesAreDraggable": false - }, - "componentName": "c:productTileList", - "id": "2bc64f0c-7a0b-4dbc-ae00-24bba78ea33c", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "d4dc54f2-fbf6-4ac3-821c-d40ce504c885", - "regionName": "content", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": {}, - "componentName": "c:productCard", - "id": "dedaad30-77eb-42e3-b344-b3be8e6a6370", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "c49cd6fe-e137-4f30-82fc-27904ef0d6c7", - "regionName": "sidebarAlt", - "type": "region" - }, - { - "id": "97a49629-26c7-431f-887e-27c32284b185", - "regionName": "footer", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "Product Explorer" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "4d25948c-bc1e-4ae9-96f6-afc56ba0514b", - "renditionMap": {}, - "type": "component" - } - ], - "id": "a4335784-1e30-4351-8ef8-aace1395bd63", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "custom-product-explorer" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productFamilyDetail.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productFamilyDetail.json deleted file mode 100644 index 170879a67..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productFamilyDetail.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "c177692a-740d-4c05-8dce-e725b859f8a1", - "label": "Product Family Detail", - "regions": [ - { - "id": "701fb246-8ba9-400b-9b0e-f6b6dd331834", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "recordId": "{!recordId}" - }, - "componentName": "forceCommunity:recordHeadline", - "id": "e9cf49a7-fde9-424a-8ddf-b9efd2613b89", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "detailsTabLabel": "Details", - "discussionsTabLabel": "Feed", - "recordId": "{!recordId}", - "relatedTabLabel": "Related", - "tab1Type": "details", - "tab2Type": "related", - "tab3Type": "none", - "tab4Type": "none", - "timelineTabLabel": "Activity" - }, - "componentName": "forceCommunity:recordHomeTabs", - "id": "ef9e0a49-fbbb-49b9-837e-91f1ea51e68a", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "cbc0b27c-2e21-4440-9505-b8edcb36ef3e", - "regionName": "content", - "type": "region" - }, - { - "id": "a5b0623e-f1b8-4b47-8445-265e4b58c9fd", - "regionName": "footer", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "{!Record._Object}: {!Record._Title}" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "2013c938-7e67-4ca1-b63d-4ef8c1221f17", - "renditionMap": {}, - "type": "component" - } - ], - "id": "62ec64d2-31f3-4be1-bf35-5999d24cbc25", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "detail-a02" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productFamilyList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productFamilyList.json deleted file mode 100644 index 7231dddd5..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productFamilyList.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "33b22787-79f5-484a-a68d-336253ee7c9d", - "label": "Product Family List", - "regions": [ - { - "id": "450dc52c-e6b8-454d-a23d-6632971ecdcc", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "enableInlineEdit": false, - "filterName": "{!filterId}", - "layout": "FULL", - "pageSize": 25, - "scope": "{!objectName}", - "showActionBar": false, - "showChartsPanel": false, - "showDisplay": "grid", - "showFilterPanel": false, - "showImageIcon": true, - "showManualRefreshButton": true, - "showObjectName": true, - "showPinnedList": false, - "showSearchBar": false - }, - "componentName": "forceCommunity:objectHome", - "id": "863231ba-9c19-4b59-ab67-fc82097ef7f3", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "51d5e69c-24e5-4b9d-88d7-0020ebeff2a2", - "regionName": "content", - "type": "region" - }, - { - "id": "be627cd1-7b18-4a9b-b80a-db1e2b825595", - "regionName": "footer", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "list-a02" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productFamilyRelatedList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productFamilyRelatedList.json deleted file mode 100644 index 0df97f79c..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productFamilyRelatedList.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "eb60ff2f-bca3-4cc7-befe-74a5cc28d67f", - "label": "Product Family Related List", - "regions": [ - { - "id": "e2525dfe-a877-4e1e-856d-057f885f9801", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "customTitle": "", - "parentRecordId": "{!recordId}", - "relatedListName": "{!relationshipApiName}", - "showBreadCrumbs": true, - "showCustomTitle": false, - "showManualRefreshButton": true, - "showRowNumbers": true - }, - "componentName": "forceCommunity:relatedList", - "id": "547f6ec6-4fbc-49e5-b87e-3b89e8db2525", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "61d84bb8-6943-4585-a1b8-be02be8b72ac", - "regionName": "content", - "type": "region" - }, - { - "id": "5021e296-247c-4759-93aa-aaf5b15f7284", - "regionName": "footer", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "relatedlist-a02" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productList.json deleted file mode 100644 index 0fa095047..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productList.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "64ffb57c-d489-405b-8ef0-9e305b69108a", - "label": "Product List", - "regions": [ - { - "id": "852e791f-ad27-425e-83b2-dd5933545e5e", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "enableInlineEdit": false, - "filterName": "{!filterId}", - "layout": "FULL", - "pageSize": 25, - "scope": "{!objectName}", - "showActionBar": false, - "showChartsPanel": false, - "showDisplay": "grid", - "showFilterPanel": false, - "showImageIcon": true, - "showManualRefreshButton": true, - "showObjectName": true, - "showPinnedList": false, - "showSearchBar": false - }, - "componentName": "forceCommunity:objectHome", - "id": "17438584-56d8-42ba-a867-b2ae874b11b3", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "520aefc8-7547-4dc3-a57b-2fc688437b75", - "regionName": "content", - "type": "region" - }, - { - "id": "cc4e11ad-9489-47fe-a79b-220bc6987cc2", - "regionName": "footer", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "list-a03" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productRelatedList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productRelatedList.json deleted file mode 100644 index b1b1252b1..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/productRelatedList.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "e264ab42-0382-4aa8-bb39-56df8e6f0aaa", - "label": "Product Related List", - "regions": [ - { - "id": "dfb9df45-f0a2-4bc7-a99f-a6a75631abf8", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "customTitle": "", - "parentRecordId": "{!recordId}", - "relatedListName": "{!relationshipApiName}", - "showBreadCrumbs": true, - "showCustomTitle": false, - "showManualRefreshButton": true, - "showRowNumbers": true - }, - "componentName": "forceCommunity:relatedList", - "id": "a2102f60-1bbc-4b4a-a0a0-14adba5d7beb", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "9194e2cf-9c2e-40ba-bc16-b55e3b189b78", - "regionName": "content", - "type": "region" - }, - { - "id": "7a4fb906-7737-4573-8a29-896adf61336d", - "regionName": "footer", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "relatedlist-a03" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/recordDetail.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/recordDetail.json deleted file mode 100644 index cfd6b2f2b..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/recordDetail.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "af3a4208-3892-4c64-a7da-4d89dbf73bcb", - "label": "Record Detail", - "regions": [ - { - "id": "e0a19fb9-98c1-4e2b-87b0-37c2dc08c542", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "recordId": "{!recordId}" - }, - "componentName": "forceCommunity:recordHeadline", - "id": "5f180dc6-bdf9-4ddd-a2ca-06bfbdcf7c12", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "detailsTabLabel": "Details", - "discussionsTabLabel": "Feed", - "recordId": "{!recordId}", - "relatedTabLabel": "Related", - "tab1Type": "details", - "tab2Type": "related", - "tab3Type": "none", - "tab4Type": "none", - "timelineTabLabel": "Activity" - }, - "componentName": "forceCommunity:recordHomeTabs", - "id": "3378cf42-1e17-450d-8b09-b265c2bc1173", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "8083f517-a504-4fcc-9c59-b46ebda7479e", - "regionName": "content", - "type": "region" - }, - { - "id": "df1a8492-bbe1-49cf-970e-8df8d703d53a", - "regionName": "footer", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "{!Record._Object}: {!Record._Title}" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "620d1dc5-0af0-4afd-9c13-74a8a4e917d6", - "renditionMap": {}, - "type": "component" - } - ], - "id": "cdee0440-2c40-4bcf-9d39-9cd08682c0f2", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "detail" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/recordList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/recordList.json deleted file mode 100644 index 5750860f2..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/recordList.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "a3538c57-83b2-4701-9517-a5f85ef7f86c", - "label": "Record List", - "regions": [ - { - "id": "b786a1cd-9a87-4e5a-8c5e-b0085d7178e6", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "enableInlineEdit": true, - "filterName": "{!filterId}", - "layout": "FULL", - "pageSize": 25, - "scope": "{!objectName}", - "showActionBar": true, - "showChartsPanel": true, - "showDisplay": "showall", - "showFilterPanel": true, - "showImageIcon": true, - "showManualRefreshButton": true, - "showObjectName": true, - "showPinnedList": true, - "showSearchBar": true - }, - "componentName": "forceCommunity:objectHome", - "id": "7c610277-decc-4e91-b1ee-f519b1784c86", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "61359c65-45e0-46f6-9365-563b66ec38b3", - "regionName": "content", - "type": "region" - }, - { - "id": "6ce62df9-f2c2-4b72-b1f6-94f08f043a75", - "regionName": "footer", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "list" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/register.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/register.json deleted file mode 100644 index 11a174f97..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/register.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "appPageId": "99145371-a7c0-4ca6-bf2f-708461f8d821", - "componentName": "siteforce:sldsOneColLayout", - "id": "c20b51fb-94a9-46e0-a944-c0511e0957cf", - "label": "Register", - "regions": [ - { - "components": [ - { - "componentAttributes": {}, - "componentName": "salesforceIdentity:communityLogo2", - "id": "c2ee8a36-3504-45c5-bba3-4f391b8789a6", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "richTextValue": "
Join the community to receive personalized information and customer support.
" - }, - "componentName": "forceCommunity:richTextInline", - "id": "438b685b-9e02-49c4-b080-17dbc5c82a9d", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "confirmPasswordLabel": "Confirm Password", - "emailLabel": "Email", - "extraFieldsFieldSet": "", - "firstnameLabel": "First Name", - "includePasswordField": false, - "lastnameLabel": "Last Name", - "passwordLabel": "Create Password", - "regConfirmUrl": "./CheckPasswordResetEmail", - "startUrl": "", - "submitButtonLabel": "Sign Up" - }, - "componentName": "salesforceIdentity:selfRegister2", - "id": "5d339d23-a121-4af6-b2ff-05c37abbe20f", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "headerText": "", - "showHeader": false - }, - "componentName": "salesforceIdentity:socialLogin2", - "id": "364b69ce-071d-423c-b0d9-574aaaffab73", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - }, - { - "componentAttributes": { - "richTextValue": "" - }, - "componentName": "forceCommunity:richTextInline", - "id": "e0a45870-3fb7-4de8-b4ff-880f6052ad09", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "d860a411-92ad-47d8-9247-2e8bbdd8a621", - "regionName": "content", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "description": "", - "metaTags": "", - "title": "Register" - }, - "componentName": "forceCommunity:seoAssistant", - "id": "46463a4e-3fd3-45c3-82d7-e9f2156cf6f3", - "renditionMap": {}, - "type": "component" - } - ], - "id": "1a04509b-993c-4184-a888-08e7661091e3", - "regionName": "sfdcHiddenRegion", - "type": "region" - } - ], - "themeLayoutType": "Login", - "type": "view", - "viewType": "self-register" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/relatedRecordList.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/relatedRecordList.json deleted file mode 100644 index 754baed5b..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/relatedRecordList.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "612a81a7-50e3-46bf-b5cd-bf7bfd2ba62a", - "label": "Related Record List", - "regions": [ - { - "id": "65fead60-f447-4d5f-b546-3b5b457b4125", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "customTitle": "", - "parentRecordId": "{!recordId}", - "relatedListName": "{!relationshipApiName}", - "showBreadCrumbs": true, - "showCustomTitle": false, - "showManualRefreshButton": true, - "showRowNumbers": true - }, - "componentName": "forceCommunity:relatedList", - "id": "7e51ce5f-3d40-4f23-863b-aae5d22eee26", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "d5a118bb-471a-445d-8e74-2129b8768fce", - "regionName": "content", - "type": "region" - }, - { - "id": "adb3f539-cf4d-426b-a265-a8232ef0e66e", - "regionName": "footer", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "relatedlist" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/search.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/search.json deleted file mode 100644 index a4a512d24..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/search.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "7067e1f5-ea41-46a0-8a85-9b528ac7ca67", - "label": "Search", - "regions": [ - { - "id": "ca51a8df-1a0e-4991-b565-0685d5d23d19", - "regionName": "header", - "type": "region" - }, - { - "components": [ - { - "componentAttributes": { - "scopes": [ - { - "isPublic": true, - "name": "FeedPost" - }, - { - "isPublic": true, - "name": "KnowledgeArticleVersion" - }, - { - "isPublic": false, - "name": "Case" - }, - { - "isPublic": true, - "name": "CollaborationGroup" - } - ], - "searchResultFiltering": true, - "searchTerm": "{!term}", - "showTopResults": true - }, - "componentName": "forceCommunity:search", - "id": "959ebd05-3f2b-4ba3-a298-508621ae2bed", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "faa99928-851d-415e-afb9-bf244484e219", - "regionName": "content", - "type": "region" - }, - { - "id": "038feeaf-22b3-4c55-9906-332695674add", - "regionName": "footer", - "type": "region" - } - ], - "themeLayoutType": "Inner", - "type": "view", - "viewType": "global-search" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/serviceNotAvailable.json b/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/serviceNotAvailable.json deleted file mode 100644 index 9729e1f60..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/experiences/E_Bikes1/views/serviceNotAvailable.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "appPageId": "591ae89d-97d7-4f5d-b93f-ce618e5d48f1", - "componentName": "siteforce:sldsOneColLayout", - "id": "051e5cc7-26ba-4366-a9f6-a0067e0d96aa", - "label": "Service Not Available", - "regions": [ - { - "components": [ - { - "componentAttributes": { - "richTextValue": "

Looks like the site is temporarily unavailable


Please try again in a bit.

" - }, - "componentName": "forceCommunity:htmlBlock", - "id": "227f6ef1-f307-416e-a04f-d20f3f756f4a", - "renderPriority": "NEUTRAL", - "renditionMap": {}, - "type": "component" - } - ], - "id": "681f110c-987f-4bb7-b8e9-902dc2115cf9", - "regionName": "content", - "type": "region" - } - ], - "themeLayoutType": "ServiceNotAvailable", - "type": "view", - "viewType": "service-not-available" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Account_Record_Page.flexipage-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Account_Record_Page.flexipage-meta.xml deleted file mode 100644 index 7cf7f9611..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Account_Record_Page.flexipage-meta.xml +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - collapsed - false - - - numVisibleActions - 3 - - force:highlightsPanel - - - Replace - header - Region - - - - - cooper:companyInsightTeaserCard - - - - - - displayOption - BOTH - - runtime_sales_merge:mergeCandidatesPreviewCard - - - - - - relatedListComponentOverride - NONE - - force:relatedListContainer - - - Replace - relatedTabContent - Facet - - - - - force:detailPanel - - - Replace - detailTabContent - Facet - - - - - runtime_sales_social:socialPanel - - - Replace - newsTabContent - Facet - - - - - - active - true - - - body - relatedTabContent - - - title - Standard.Tab.relatedLists - - flexipage:tab - - - - - - body - detailTabContent - - - title - Standard.Tab.detail - - flexipage:tab - - - - - - body - newsTabContent - - - title - Standard.Tab.news - - flexipage:tab - - - Replace - maintabs - Facet - - - - - - tabs - maintabs - - flexipage:tabset - - - Replace - main - Region - - - - - runtime_sales_activities:activityPanel - - - Replace - activityTabContent - Facet - - - - - forceChatter:recordFeedContainer - - - Replace - feedTabContent - Facet - - - - - - active - true - - - body - activityTabContent - - - title - Standard.Tab.activity - - flexipage:tab - - - - - - body - feedTabContent - - - title - Standard.Tab.collaborate - - flexipage:tab - - - Replace - sidebartabs - Facet - - - - - accountMap - - - - - - tabs - sidebartabs - - flexipage:tabset - - - Replace - sidebar - Region - - Account Record Page - sfa__Account_rec_L - Account - - RecordPage - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Order_Record_Page.flexipage-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Order_Record_Page.flexipage-meta.xml deleted file mode 100644 index 30a36a13d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Order_Record_Page.flexipage-meta.xml +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - - collapsed - false - - - enableActionsConfiguration - false - - - hideChatterActions - false - - force:highlightsPanel - - - Replace - header - Region - - - - - - relatedListComponentOverride - NONE - - - rowsToDisplay - 10 - - - showActionBar - true - - force:relatedListContainer - - - Replace - relatedTabContent - Facet - - - - - - uiBehavior - required - - Record.Account__c - - - Facet-5109d7d1-dd5b-4058-b438-645b94ab5d5f - Facet - - - - - - uiBehavior - readonly - - Record.CreatedById - - - - - - uiBehavior - readonly - - Record.LastModifiedById - - - Facet-24481a15-ff0a-486e-9b84-705cee2963d1 - Facet - - - - - - body - Facet-5109d7d1-dd5b-4058-b438-645b94ab5d5f - - flexipage:column - - - - - - body - Facet-24481a15-ff0a-486e-9b84-705cee2963d1 - - flexipage:column - - - Facet-e70a8d02-0661-4bca-92b4-62d514246789 - Facet - - - - - - columns - Facet-e70a8d02-0661-4bca-92b4-62d514246789 - - - label - Information - - flexipage:fieldSection - - - Facet-07a3ffa3-2ce8-4764-8215-3b56c7eb1aeb - Facet - - - Facet-724d8a06-9c83-4647-b61a-d7d88d2bbcd7 - Facet - - - Facet-f4868b5f-b091-46f4-96c1-36696d5f54b7 - Facet - - - - - - body - Facet-724d8a06-9c83-4647-b61a-d7d88d2bbcd7 - - flexipage:column - - - - - - body - Facet-f4868b5f-b091-46f4-96c1-36696d5f54b7 - - flexipage:column - - - Facet-d8ef1bea-6920-417b-9e72-faa11bed4dd6 - Facet - - - - - - columns - Facet-d8ef1bea-6920-417b-9e72-faa11bed4dd6 - - - label - System Information - - flexipage:fieldSection - - - Facet-b2033f7e-adc2-45cf-9f61-1b71d4aa75c1 - Facet - - - - - - body - Facet-07a3ffa3-2ce8-4764-8215-3b56c7eb1aeb - - - label - Standard.Tab.fields - - - name - accordionSection1 - - flexipage:accordionSection - - - - - - body - Facet-b2033f7e-adc2-45cf-9f61-1b71d4aa75c1 - - - label - Standard.Tab.additionalFields - - - name - accordionSection2 - - flexipage:accordionSection - - - Facet-3a2cee67-d9a2-412d-956e-27ea37493209 - Facet - - - - - - accordionSections - Facet-3a2cee67-d9a2-412d-956e-27ea37493209 - - - defaultSectionName - accordionSection1 - - flexipage:accordion - - - - - force:recordDetailPanelMobile - - - - - orderBuilder - - - Replace - detailTabContent - Facet - - - - - - body - relatedTabContent - - - title - Standard.Tab.relatedLists - - flexipage:tab - - - - - - active - true - - - body - detailTabContent - - - title - Standard.Tab.detail - - flexipage:tab - - - Replace - maintabs - Facet - - - - - - tabs - maintabs - - flexipage:tabset - - - Replace - main - Region - - - - - - searchBarIsVisible - true - - - tilesAreDraggable - true - - productTileList - - - Replace - sidebar - Region - - Order Record Page - flexipage__default_rec_L - Order__c - - RecordPage - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Product_Explorer.flexipage-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Product_Explorer.flexipage-meta.xml deleted file mode 100644 index 4927e2eaf..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Product_Explorer.flexipage-meta.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - productFilter - - - left - Region - - - - - productTileList - - - center - Region - - - - - productCard - - - right - Region - - Product Explorer - - AppPage - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Product_Record_Page.flexipage-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Product_Record_Page.flexipage-meta.xml deleted file mode 100644 index 95cfb7e73..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/flexipages/Product_Record_Page.flexipage-meta.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - collapsed - false - - force:highlightsPanel - - - Replace - header - Region - - - - - - relatedListComponentOverride - NONE - - force:relatedListContainer - - - Replace - relatedTabContent - Facet - - - - - force:detailPanel - - - Replace - detailTabContent - Facet - - - - - - body - relatedTabContent - - - title - Standard.Tab.relatedLists - - flexipage:tab - - - - - - active - true - - - body - detailTabContent - - - title - Standard.Tab.detail - - flexipage:tab - - - Replace - maintabs - Facet - - - - - - tabs - maintabs - - flexipage:tabset - - - Replace - main - Region - - - - - similarProducts - - - Replace - sidebar - Region - - Product Record Page - flexipage__default_rec_L - Product__c - - RecordPage - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/layouts/Case-Case Layout.layout-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/layouts/Case-Case Layout.layout-meta.xml deleted file mode 100644 index e661d5168..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/layouts/Case-Case Layout.layout-meta.xml +++ /dev/null @@ -1,338 +0,0 @@ - - - false - - true - true - LeftFixed - - AllUpdates - - - FeedItemType - CallLogPost - - - FeedItemType - TextPost - - - FeedItemType - ChangeStatusPost - - - FeedItemType - ActivityEvent - - true - true - false - - HelpAndToolLinks - - - Following - - - Followers - - - Topics - - - CustomLinks - - - CustomButtons - - false - - PersonalTagging - PublicTagging - - false - false - true - - - - Edit - OwnerId - - - Readonly - CaseNumber - - - Edit - ContactId - - - Readonly - AccountId - - - Edit - Type - - - Edit - Reason - - - Edit - Product__c - - - Edit - Case_Category__c - - - - - Required - Status - - - Edit - Priority - - - Readonly - ContactPhone - - - Readonly - ContactEmail - - - Required - Origin - - - - - - false - false - true - - - - Readonly - SuppliedEmail - - - Readonly - SuppliedName - - - Readonly - CreatedDate - - - - - Readonly - SuppliedCompany - - - Readonly - SuppliedPhone - - - Readonly - ClosedDate - - - - - - false - false - true - - - - - - - false - false - true - - - - Readonly - CreatedById - - - - - Readonly - LastModifiedById - - - - - - false - false - true - - - - Edit - Subject - - - Edit - Description - - - Edit - Comments - - - - - - false - false - false - - - - - - - - FeedItem.TextPost - - - Case.LogACall - - - Case.CaseComment - - - Case.ChangeStatus - - - FeedItem.ContentPost - - - FeedItem.LinkPost - - - FeedItem.PollPost - - - - - - Readonly - ContactId - - - - - Readonly - AccountId - - - - - TASK.SUBJECT - TASK.WHO_NAME - ACTIVITY.TASK - TASK.DUE_DATE - TASK.STATUS - TASK.PRIORITY - CORE.USERS.FULL_NAME - RelatedActivityList - - - TASK.SUBJECT - TASK.WHO_NAME - ACTIVITY.TASK - TASK.DUE_DATE - CORE.USERS.FULL_NAME - TASK.LAST_UPDATE - RelatedHistoryList - - - RelatedCommentsList - - - RelatedAttachmentList - - - RelatedEntityHistoryList - - ContactId - AccountId - false - true - true - false - true - true - true - - 00h1a0000012AGt - 3 - 4 - - ContactId - 0 - 0 - - - AccountId - 0 - 1 - - - ContactPhone - 0 - 2 - - - CaseNumber - 1 - 0 - - - CreatedDate - 1 - 1 - - - Subject - 1 - 2 - - - Description - 1 - 3 - - - Status - 2 - 0 - - - Priority - 2 - 1 - - - OwnerId - 2 - 2 - - CaseInteraction - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/layouts/CaseClose-Close Case Layout.layout-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/layouts/CaseClose-Close Case Layout.layout-meta.xml deleted file mode 100644 index f52cccb95..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/layouts/CaseClose-Close Case Layout.layout-meta.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - false - false - true - - - - Required - Status - - - Required - Reason - - - Edit - Comments - - - Edit - Product__c - - - Edit - Case_Category__c - - - - - false - false - false - false - true - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/layouts/Order_Item__c-Order Item Layout.layout-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/layouts/Order_Item__c-Order Item Layout.layout-meta.xml deleted file mode 100644 index f54626467..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/layouts/Order_Item__c-Order Item Layout.layout-meta.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - false - false - true - - - - Readonly - Name - - - Edit - Qty_S__c - - - Edit - Qty_M__c - - - Edit - Qty_L__c - - - Required - Order__c - - - Edit - Product__c - - - Edit - Price__c - - - - - - - false - false - true - - - - Readonly - CreatedById - - - - - Readonly - LastModifiedById - - - - - - false - false - true - - - - - - false - false - false - false - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/layouts/Order__c-Order Layout.layout-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/layouts/Order__c-Order Layout.layout-meta.xml deleted file mode 100644 index a7f985e21..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/layouts/Order__c-Order Layout.layout-meta.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - false - false - true - - - - Readonly - Name - - - Required - Account__c - - - - - Readonly - CreatedById - - - Readonly - LastModifiedById - - - - - - false - false - true - - - - - - - true - false - true - - - - - - - - NAME - Order_Item__c.Order__c - - false - false - false - false - false - - 00h9A000000NiAr - 4 - 0 - Default - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/layouts/Product_Family__c-Product Family Layout.layout-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/layouts/Product_Family__c-Product Family Layout.layout-meta.xml deleted file mode 100644 index 89615318c..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/layouts/Product_Family__c-Product Family Layout.layout-meta.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - false - false - true - - - - Required - Name - - - Edit - Description__c - - - Edit - Category__c - - - - - Edit - OwnerId - - - - - - false - false - true - - - - Readonly - CreatedById - - - - - Readonly - LastModifiedById - - - - - - false - false - true - - - - - - - NAME - Product__c.Product_Family__c - - false - false - false - false - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/layouts/Product__c-Product Layout.layout-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/layouts/Product__c-Product Layout.layout-meta.xml deleted file mode 100644 index d884c3d2d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/layouts/Product__c-Product Layout.layout-meta.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - Submit - - false - false - true - - - - Required - Name - - - Edit - Description__c - - - Edit - Product_Family__c - - - Edit - Picture_URL__c - - - Edit - OwnerId - - - Edit - Motor__c - - - Edit - Fork__c - - - Edit - Frame_Color__c - - - Edit - Handlebar_Color__c - - - - - Edit - Category__c - - - Edit - MSRP__c - - - Edit - Material__c - - - Edit - Battery__c - - - Edit - Charger__c - - - Edit - Level__c - - - Edit - Front_Brakes__c - - - Edit - Rear_Brakes__c - - - Edit - Seat_Color__c - - - Edit - Waterbottle_Color__c - - - - - - false - false - true - - - - Readonly - CreatedById - - - - - Readonly - LastModifiedById - - - - - - true - false - true - - - - - - - false - false - false - false - false - - 00he0000000X2xd - 4 - 0 - Default - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/.eslintrc.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/.eslintrc.json deleted file mode 100644 index a28f942d8..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/.eslintrc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": ["@salesforce/eslint-config-lwc/recommended", "prettier"], - "overrides": [ - { - "files": ["*.test.js"], - "rules": { - "@lwc/lwc/no-unexpected-wire-adapter-usages": "off" - } - } - ] -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/__tests__/accountMap.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/__tests__/accountMap.test.js deleted file mode 100644 index 276cf68cd..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/__tests__/accountMap.test.js +++ /dev/null @@ -1,140 +0,0 @@ -import { createElement } from 'lwc'; -import AccountMap from 'c/accountMap'; -import { getRecord } from 'lightning/uiRecordApi'; -import { registerLdsTestWireAdapter } from '@salesforce/sfdx-lwc-jest'; - -// Realistic data with an accounts address details -const mockGetRecordWithAddress = require('./data/getRecordWithAddress.json'); -const mockGetRecordWithoutAddress = require('./data/getRecordWithoutAddress.json'); -const mockRecordId = '0031700000pJRRSAA4'; -const mockWireErrorMessage = 'Error retrieving record'; - -// Register as a LDS wire adapter. Some tests verify the provisioned values trigger desired behavior. -const getRecordAdapter = registerLdsTestWireAdapter(getRecord); -describe('c-account-map', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - }); - - it('displays a lightning-map when wire adaptor returns an account record with billing street data', () => { - // Create element - const element = createElement('c-account-map', { - is: AccountMap - }); - // Set public properties - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit data from the get record adapter that includes billing street data - getRecordAdapter.emit(mockGetRecordWithAddress); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Select elements for validation - const mapEl = element.shadowRoot.querySelector('lightning-map'); - expect(mapEl).not.toBeNull(); - expect(mapEl.zoomLevel).toBe(14); - - // Get the map markers from mapEl to check that the location data has been populated - const location = mapEl.mapMarkers[0].location; - expect(location).toEqual( - expect.objectContaining({ - City: 'San Francisco', - Country: 'USA', - PostalCode: '94105', - State: 'California', - Street: '415 Mission St.' - }) - ); - }); - }); - - it('displays an error panel when the wire adaptor returns an empty array', () => { - // Create element - const element = createElement('c-account-map', { - is: AccountMap - }); - // Set public properties - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit data from the get record adapter that does not include billing street data - getRecordAdapter.emit(mockGetRecordWithoutAddress); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Select elements for validation - const mapEl = element.shadowRoot.querySelector('lightning-map'); - expect(mapEl).toBeNull(); - const errorPanelEl = - element.shadowRoot.querySelector('c-error-panel'); - expect(errorPanelEl).not.toBeNull(); - expect(errorPanelEl.friendlyMessage).toBe('No address to map'); - }); - }); - - it('displays an error panel when wire adapter returns an error', () => { - // Create element - const element = createElement('c-account-map', { - is: AccountMap - }); - // Set public properties - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit an error from the getRecord adapter. - getRecordAdapter.error(mockWireErrorMessage); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Select elements for validation - const errorPanelEl = - element.shadowRoot.querySelectorAll('c-error-panel'); - // There are two error panels in the component - we need the second to check - // the wire errors are displaying correctly - const errorPanel = errorPanelEl[1]; - expect(errorPanel).not.toBeNull(); - expect(errorPanel.errors.body).toBe(mockWireErrorMessage); - expect(errorPanel.friendlyMessage).toBe( - 'Error retrieving map data' - ); - }); - }); - - it('is accessible when showing map', () => { - const element = createElement('c-account-map', { - is: AccountMap - }); - - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit data from the get record adapter that includes billing street data - getRecordAdapter.emit(mockGetRecordWithAddress); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); - - it('is accessible when showing error', () => { - const element = createElement('c-account-map', { - is: AccountMap - }); - - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit an error from the getRecord adapter. - getRecordAdapter.error(mockWireErrorMessage); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/__tests__/data/getRecordWithAddress.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/__tests__/data/getRecordWithAddress.json deleted file mode 100644 index 9ff51992b..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/__tests__/data/getRecordWithAddress.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "fields": { - "BillingCity": { - "displayValue": null, - "value": "San Francisco" - }, - "BillingCountry": { - "displayValue": null, - "value": "USA" - }, - "BillingPostalCode": { - "displayValue": null, - "value": "94105" - }, - "BillingState": { - "displayValue": null, - "value": "California" - }, - "BillingStreet": { - "displayValue": null, - "value": "415 Mission St." - } - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/__tests__/data/getRecordWithoutAddress.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/__tests__/data/getRecordWithoutAddress.json deleted file mode 100644 index 59f4047ec..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/__tests__/data/getRecordWithoutAddress.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "fields": { - "BillingCity": { - "displayValue": null, - "value": null - }, - "BillingCountry": { - "displayValue": null, - "value": null - }, - "BillingPostalCode": { - "displayValue": null, - "value": null - }, - "BillingState": { - "displayValue": null, - "value": null - }, - "BillingStreet": { - "displayValue": null, - "value": null - } - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/accountMap.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/accountMap.html deleted file mode 100644 index b291b5b79..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/accountMap.html +++ /dev/null @@ -1,19 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/accountMap.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/accountMap.js deleted file mode 100644 index 3838733f8..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/accountMap.js +++ /dev/null @@ -1,52 +0,0 @@ -import { LightningElement, api, wire } from 'lwc'; -import { getRecord, getFieldValue } from 'lightning/uiRecordApi'; - -import BILLING_CITY from '@salesforce/schema/Account.BillingCity'; -import BILLING_COUNTRY from '@salesforce/schema/Account.BillingCountry'; -import BILLING_POSTAL_CODE from '@salesforce/schema/Account.BillingPostalCode'; -import BILLING_STATE from '@salesforce/schema/Account.BillingState'; -import BILLING_STREET from '@salesforce/schema/Account.BillingStreet'; - -const fields = [ - BILLING_CITY, - BILLING_COUNTRY, - BILLING_POSTAL_CODE, - BILLING_STATE, - BILLING_STREET -]; - -export default class PropertyMap extends LightningElement { - @api recordId; - - zoomLevel = 14; - markers = []; - error; - - @wire(getRecord, { recordId: '$recordId', fields }) - wiredRecord({ error, data }) { - if (data) { - this.markers = []; - this.error = undefined; - const street = getFieldValue(data, BILLING_STREET); - if (street) { - this.markers = [ - { - location: { - City: getFieldValue(data, BILLING_CITY), - Country: getFieldValue(data, BILLING_COUNTRY), - PostalCode: getFieldValue( - data, - BILLING_POSTAL_CODE - ), - State: getFieldValue(data, BILLING_STATE), - Street: street - } - } - ]; - } - } else if (error) { - this.markers = []; - this.error = error; - } - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/accountMap.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/accountMap.js-meta.xml deleted file mode 100644 index 9aaee0708..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/accountMap/accountMap.js-meta.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - 52.0 - true - Account Map - - lightning__RecordPage - - - - - Account - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.css deleted file mode 100644 index 55f228368..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.css +++ /dev/null @@ -1,8 +0,0 @@ -.title-order, -.submit-button { - font-weight: bold; -} - -.navigate-hidden { - display: none; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.html deleted file mode 100644 index 5b7d663fc..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.html +++ /dev/null @@ -1,65 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.js deleted file mode 100644 index 2d4c1ea92..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.js +++ /dev/null @@ -1,37 +0,0 @@ -import { LightningElement } from 'lwc'; -import { ShowToastEvent } from 'lightning/platformShowToastEvent'; - -import CASE_OBJECT from '@salesforce/schema/Case'; -import SUBJECT from '@salesforce/schema/Case.Subject'; -import DESCRIPTION from '@salesforce/schema/Case.Description'; -import PRODUCT from '@salesforce/schema/Case.Product__c'; -import PRIORITY from '@salesforce/schema/Case.Priority'; -import CASE_CATEGORY from '@salesforce/schema/Case.Case_Category__c'; -import REASON from '@salesforce/schema/Case.Reason'; - -const TITLE_SUCCESS = 'Case Created!'; -const MESSAGE_SUCCESS = 'You have successfully created a Case'; - -export default class CreateCase extends LightningElement { - caseObject = CASE_OBJECT; - subjectField = SUBJECT; - productField = PRODUCT; - descriptionField = DESCRIPTION; - priorityField = PRIORITY; - reasonField = REASON; - categoryField = CASE_CATEGORY; - - handleCaseCreated() { - // Fire event for Toast to appear that Order was created - const evt = new ShowToastEvent({ - title: TITLE_SUCCESS, - message: MESSAGE_SUCCESS, - variant: 'success' - }); - this.dispatchEvent(evt); - - const refreshEvt = new CustomEvent('refresh'); - // Fire the custom event - this.dispatchEvent(refreshEvt); - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.js-meta.xml deleted file mode 100644 index 8dfca5954..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/createCase/createCase.js-meta.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - 52.0 - true - Create Case - - lightningCommunity__Page - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/__tests__/errorPanel.tests.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/__tests__/errorPanel.tests.js deleted file mode 100644 index 5d8160004..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/__tests__/errorPanel.tests.js +++ /dev/null @@ -1,78 +0,0 @@ -import { createElement } from 'lwc'; -import ErrorPanel from 'c/errorPanel'; - -describe('c-error-panel', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - }); - - it('displays a default friendly message', () => { - const MESSAGE = 'Error retrieving data'; - - // Create initial element - const element = createElement('c-error-panel', { - is: ErrorPanel - }); - document.body.appendChild(element); - - const messageEl = element.shadowRoot.querySelector('h3'); - expect(messageEl.textContent).toBe(MESSAGE); - }); - - it('displays a custom friendly message', () => { - const MESSAGE = 'Errors are bad'; - - // Create initial element - const element = createElement('c-error-panel', { - is: ErrorPanel - }); - element.friendlyMessage = MESSAGE; - document.body.appendChild(element); - - const messageEl = element.shadowRoot.querySelector('h3'); - expect(messageEl.textContent).toBe(MESSAGE); - }); - - it('displays no error details when no errors are passed as parameters', () => { - // Create initial element - const element = createElement('c-error-panel', { - is: ErrorPanel - }); - document.body.appendChild(element); - - const inputEl = element.shadowRoot.querySelector('lightning-input'); - expect(inputEl).toBeNull(); - }); - - it('displays error details when errors are passed as parameters', () => { - const ERROR_MESSAGES_INPUT = [ - { statusText: 'First bad error' }, - { statusText: 'Second bad error' } - ]; - const ERROR_MESSAGES_OUTPUT = ['First bad error', 'Second bad error']; - - // Create initial element - const element = createElement('c-error-panel', { - is: ErrorPanel - }); - element.errors = ERROR_MESSAGES_INPUT; - document.body.appendChild(element); - - const inputEl = element.shadowRoot.querySelector('a'); - inputEl.checked = true; - inputEl.dispatchEvent(new CustomEvent('click')); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - const messageTexts = Array.from( - element.shadowRoot.querySelectorAll('p') - ).map((errorMessage) => (errorMessage = errorMessage.textContent)); - expect(messageTexts).toEqual(ERROR_MESSAGES_OUTPUT); - }); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/errorPanel.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/errorPanel.js deleted file mode 100644 index b05f2e633..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/errorPanel.js +++ /dev/null @@ -1,28 +0,0 @@ -import { LightningElement, api } from 'lwc'; -import { reduceErrors } from 'c/ldsUtils'; -import noDataIllustration from './templates/noDataIllustration.html'; -import inlineMessage from './templates/inlineMessage.html'; - -export default class ErrorPanel extends LightningElement { - /** Single or array of LDS errors */ - @api errors; - /** Generic / user-friendly message */ - @api friendlyMessage = 'Error retrieving data'; - /** Type of error message **/ - @api type; - - viewDetails = false; - - get errorMessages() { - return reduceErrors(this.errors); - } - - handleShowDetailsClick() { - this.viewDetails = !this.viewDetails; - } - - render() { - if (this.type === 'inlineMessage') return inlineMessage; - return noDataIllustration; - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/errorPanel.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/errorPanel.js-meta.xml deleted file mode 100644 index fe23df019..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/errorPanel.js-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 52.0 - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/templates/inlineMessage.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/templates/inlineMessage.html deleted file mode 100755 index b49ea138b..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/templates/inlineMessage.html +++ /dev/null @@ -1,19 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/templates/noDataIllustration.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/templates/noDataIllustration.html deleted file mode 100644 index 3d5429320..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/errorPanel/templates/noDataIllustration.html +++ /dev/null @@ -1,260 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/__tests__/hero.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/__tests__/hero.test.js deleted file mode 100644 index 7647ff7b2..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/__tests__/hero.test.js +++ /dev/null @@ -1,232 +0,0 @@ -import { createElement } from 'lwc'; -import Hero from 'c/hero'; -import IMAGE_URL from '@salesforce/resourceUrl/bike_assets'; - -// Mock realistic data for the public properties -const mockTitle = 'Title'; -const mockSlogan = 'Slogan'; -const mockButtonText = 'Click Me!'; -const mockHeroDetailsPositionLEFT = 'left'; -const mockHeroDetailsPositionRIGHT = 'right'; -const mockResourceUrl = 'www.salesforce.com'; -const mockImgOrVideoIMAGE = 'Image'; -const mockImgOrVideoVIDEO = 'Video'; -const mockInternalResource = true; -const mockOverlay = 'true'; -const mockOpacity = 5; -const mockButtonClickProductOrFamilyName = 'Product'; - -describe('c-hero', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - }); - - it('displays an image in the hero when the type is image', () => { - const element = createElement('c-hero', { - is: Hero - }); - element.title = mockTitle; - element.slogan = mockSlogan; - element.buttonText = mockButtonText; - element.heroDetailsPosition = mockHeroDetailsPositionLEFT; - element.resourceUrl = mockResourceUrl; - element.imgOrVideo = mockImgOrVideoIMAGE; - element.internalResource = mockInternalResource; - element.overlay = mockOverlay; - element.opacity = mockOpacity; - element.buttonClickProductOrFamilyName = - mockButtonClickProductOrFamilyName; - document.body.appendChild(element); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Select elements for validation - const imageEl = element.shadowRoot.querySelector('img'); - expect(imageEl).not.toBeNull(); - // Verify that the URL returned matches, in the context of the test, the domain will render as http://localhost/ - expect(imageEl.src).toBe( - `http://localhost/${IMAGE_URL}${mockResourceUrl}` - ); - }); - }); - - it('displays an video in the hero when the type is video', () => { - const element = createElement('c-hero', { - is: Hero - }); - element.title = mockTitle; - element.resourceUrl = mockResourceUrl; - element.imgOrVideo = mockImgOrVideoVIDEO; - element.internalResource = mockInternalResource; - document.body.appendChild(element); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Select elements for validation - const sourceEl = element.shadowRoot.querySelector('source'); - expect(sourceEl).not.toBeNull(); - // Verify that the URL returned matches, in the context of the test, the domain will render as http://localhost/ - expect(sourceEl.src).toBe(`http://localhost/${mockResourceUrl}`); - }); - }); - - it('displays an overlay', () => { - const element = createElement('c-hero', { - is: Hero - }); - element.title = mockTitle; - element.overlay = mockOverlay; - element.opacity = mockOpacity; - document.body.appendChild(element); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Select elements for validation - const divEl = element.shadowRoot.querySelector('div'); - expect(divEl).not.toBeNull(); - expect(divEl.style.opacity).toBe('0.5'); - }); - }); - - it('displays the hero details component positioned left', () => { - const element = createElement('c-hero', { - is: Hero - }); - element.title = mockTitle; - element.slogan = mockSlogan; - element.buttonText = mockButtonText; - element.heroDetailsPosition = mockHeroDetailsPositionLEFT; - element.buttonClickProductOrFamilyName = - mockButtonClickProductOrFamilyName; - document.body.appendChild(element); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Select elements for validation - const heroDetailsEL = - element.shadowRoot.querySelector('c-hero-details'); - expect(heroDetailsEL).not.toBeNull(); - expect( - heroDetailsEL.classList.contains('c-hero-center-left') - ).toBeTruthy(); - expect(heroDetailsEL.title).toBe(mockTitle); - expect(heroDetailsEL.slogan).toBe(mockSlogan); - expect(heroDetailsEL.recordName).toBe( - mockButtonClickProductOrFamilyName - ); - const spanEl = element.shadowRoot.querySelector('span'); - expect(spanEl.textContent).toBe(mockButtonText); - }); - }); - - it('displays the hero details component positioned right', () => { - const element = createElement('c-hero', { - is: Hero - }); - element.title = mockTitle; - element.slogan = mockSlogan; - element.buttonText = mockButtonText; - element.heroDetailsPosition = mockHeroDetailsPositionRIGHT; - element.buttonClickProductOrFamilyName = - mockButtonClickProductOrFamilyName; - document.body.appendChild(element); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Select elements for validation - const heroDetailsEL = - element.shadowRoot.querySelector('c-hero-details'); - expect(heroDetailsEL).not.toBeNull(); - expect( - heroDetailsEL.classList.contains('c-hero-center-right') - ).toBeTruthy(); - expect(heroDetailsEL.title).toBe(mockTitle); - expect(heroDetailsEL.slogan).toBe(mockSlogan); - expect(heroDetailsEL.recordName).toBe( - mockButtonClickProductOrFamilyName - ); - const spanEl = element.shadowRoot.querySelector('span'); - expect(spanEl.textContent).toBe(mockButtonText); - }); - }); - - it('displays the hero details component positioned center', () => { - const element = createElement('c-hero', { - is: Hero - }); - element.title = mockTitle; - element.slogan = mockSlogan; - element.buttonText = mockButtonText; - element.buttonClickProductOrFamilyName = - mockButtonClickProductOrFamilyName; - document.body.appendChild(element); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Select elements for validation - const heroDetailsEL = - element.shadowRoot.querySelector('c-hero-details'); - expect(heroDetailsEL).not.toBeNull(); - expect( - heroDetailsEL.classList.contains('c-hero-center-default') - ).toBeTruthy(); - expect(heroDetailsEL.title).toBe(mockTitle); - expect(heroDetailsEL.slogan).toBe(mockSlogan); - expect(heroDetailsEL.recordName).toBe( - mockButtonClickProductOrFamilyName - ); - const spanEl = element.shadowRoot.querySelector('span'); - expect(spanEl.textContent).toBe(mockButtonText); - }); - }); - - it('is accessible when type image and overlay displayed', () => { - const element = createElement('c-hero', { - is: Hero - }); - - element.title = mockTitle; - element.slogan = mockSlogan; - element.buttonText = mockButtonText; - element.heroDetailsPosition = mockHeroDetailsPositionLEFT; - element.resourceUrl = mockResourceUrl; - element.imgOrVideo = mockImgOrVideoIMAGE; - element.internalResource = mockInternalResource; - element.overlay = mockOverlay; - element.opacity = mockOpacity; - element.buttonClickProductOrFamilyName = - mockButtonClickProductOrFamilyName; - document.body.appendChild(element); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); - - it('is accessible when type video and overlay displayed', () => { - const element = createElement('c-hero', { - is: Hero - }); - - element.title = mockTitle; - element.resourceUrl = mockResourceUrl; - element.imgOrVideo = mockImgOrVideoVIDEO; - element.internalResource = mockInternalResource; - document.body.appendChild(element); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.css deleted file mode 100644 index 25b2cc4d5..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.css +++ /dev/null @@ -1,31 +0,0 @@ -:host { - position: relative; - display: block; -} - -img, -video { - position: relative; - width: 100%; -} - -.c-hero-center-default, -.c-hero-center-left { - top: 30%; - left: 10%; -} - -.c-hero-center-right { - top: 30%; - right: 10%; -} - -div { - background-color: black; - opacity: 0.5; - top: 0; - bottom: 0; - left: 0; - right: 0; - position: absolute; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.html deleted file mode 100644 index 317ec9dd3..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.html +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.js deleted file mode 100644 index 58a864a39..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.js +++ /dev/null @@ -1,61 +0,0 @@ -import { LightningElement, api } from 'lwc'; -import IMAGE_URL from '@salesforce/resourceUrl/bike_assets'; - -const VIDEO = 'Video'; -const IMAGE = 'Image'; - -/** - * A Hero component that can display a Video or Image. - */ -export default class Hero extends LightningElement { - @api title; - @api slogan; - @api buttonText; - @api heroDetailsPosition; - @api resourceUrl; - @api imgOrVideo; - @api internalResource; - @api overlay; - @api opacity; - @api buttonClickProductOrFamilyName; - - get resUrl() { - if (this.isImg) { - if (this.internalResource) { - return IMAGE_URL + this.resourceUrl; - } - } - return this.resourceUrl; - } - - get isVideo() { - return this.imgOrVideo === VIDEO; - } - - get isImg() { - return this.imgOrVideo === IMAGE; - } - - get isOverlay() { - return this.overlay === 'true'; - } - - // Apply CSS Class depending upon what position to put the hero text block - get heroDetailsPositionClass() { - if (this.heroDetailsPosition === 'left') { - return 'c-hero-center-left'; - } else if (this.heroDetailsPosition === 'right') { - return 'c-hero-center-right'; - } - - return 'c-hero-center-default'; - } - - renderedCallback() { - // Update the overlay with the opacity configured by the admin in builder - const overlay = this.template.querySelector('div'); - if (overlay) { - overlay.style.opacity = parseInt(this.opacity, 10) / 10; - } - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.js-meta.xml deleted file mode 100644 index 9a07da997..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/hero/hero.js-meta.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 52.0 - true - Hero - - lightningCommunity__Page - lightningCommunity__Default - - - - - - - - - - - - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/__tests__/data/getRecordInfoProduct.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/__tests__/data/getRecordInfoProduct.json deleted file mode 100644 index 29b0d8664..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/__tests__/data/getRecordInfoProduct.json +++ /dev/null @@ -1 +0,0 @@ -["a023B000002yg4IQAQ", "Product__c"] diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/__tests__/data/getRecordInfoProductFamily.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/__tests__/data/getRecordInfoProductFamily.json deleted file mode 100644 index 10c7440ac..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/__tests__/data/getRecordInfoProductFamily.json +++ /dev/null @@ -1 +0,0 @@ -["a023B000002yg4IQAQ", "ProductFamily__c"] diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/__tests__/heroDetails.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/__tests__/heroDetails.test.js deleted file mode 100644 index e994a8213..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/__tests__/heroDetails.test.js +++ /dev/null @@ -1,119 +0,0 @@ -import { createElement } from 'lwc'; -import HeroDetails from 'c/heroDetails'; -import { registerApexTestWireAdapter } from '@salesforce/sfdx-lwc-jest'; -import getRecordInfo from '@salesforce/apex/ProductRecordInfoController.getRecordInfo'; - -// Mock realistic data for the getRecordInfo adapter -const mockGetRecordInfoProduct = require('./data/getRecordInfoProduct.json'); -const mockGetRecordInfoProductFamily = require('./data/getRecordInfoProductFamily.json'); - -// Mock realistic data for the public properties -const mockTitle = 'Title'; -const mockSlogan = 'Slogan'; -const mockRecordName = 'Electra'; - -//Expected Wire Input -const WIRE_INPUT = { - productOrFamilyName: 'Electra' -}; - -// Register as an LDS wire adapter. Some tests verify the provisioned values trigger desired behavior. -const getRecordInfoAdapter = registerApexTestWireAdapter(getRecordInfo); - -describe('c-hero-details', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - }); - - it('sets the href URL to a Product__c', () => { - const element = createElement('c-hero-details', { - is: HeroDetails - }); - element.recordName = mockRecordName; - document.body.appendChild(element); - - // Emit Data from the Apex wire adapter. - getRecordInfoAdapter.emit(mockGetRecordInfoProduct); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Check the wire parameters are correct - expect(getRecordInfoAdapter.getLastConfig()).toEqual(WIRE_INPUT); - // Select elements for validation - const anchorEl = element.shadowRoot.querySelector('a'); - expect(anchorEl).not.toBeNull(); - expect(anchorEl.href).toBe( - `http://localhost/product/${mockGetRecordInfoProduct[0]}` - ); - }); - }); - - it('sets the href URL to a Product_Family__c', () => { - const element = createElement('c-hero-details', { - is: HeroDetails - }); - element.recordName = mockRecordName; - document.body.appendChild(element); - - // Emit Data from the Apex wire adapter. - getRecordInfoAdapter.emit(mockGetRecordInfoProductFamily); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Check the wire parameters are correct - expect(getRecordInfoAdapter.getLastConfig()).toEqual(WIRE_INPUT); - // Select elements for validation - const anchorEl = element.shadowRoot.querySelector('a'); - expect(anchorEl).not.toBeNull(); - expect(anchorEl.href).toBe( - `http://localhost/product-family/${mockGetRecordInfoProduct[0]}` - ); - }); - }); - - it('displays the title and slogan', () => { - const element = createElement('c-hero-details', { - is: HeroDetails - }); - element.title = mockTitle; - element.slogan = mockSlogan; - element.recordName = mockRecordName; - document.body.appendChild(element); - - // Emit Data from the Apex wire adapter. - getRecordInfoAdapter.emit(mockGetRecordInfoProductFamily); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Check the wire parameters are correct - expect(getRecordInfoAdapter.getLastConfig()).toEqual(WIRE_INPUT); - // Select elements for validation - const headingEL = element.shadowRoot.querySelector('h1'); - expect(headingEL.textContent).toBe(mockTitle); - const paragraphEl = element.shadowRoot.querySelector('p'); - expect(paragraphEl.textContent).toBe(mockSlogan); - }); - }); - - it('is accessible', () => { - const element = createElement('c-hero-details', { - is: HeroDetails - }); - - element.title = mockTitle; - element.slogan = mockSlogan; - element.recordName = mockRecordName; - document.body.appendChild(element); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.css deleted file mode 100644 index 5e01487b7..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.css +++ /dev/null @@ -1,43 +0,0 @@ -:host { - position: absolute; - text-align: center; -} - -h1, -p { - color: var(--lwc-colorTextButtonBrand, white); - font-family: 'KlavikaWebRegularCond', 'Klavika', Helvetica; - margin-bottom: 10px; - font-weight: normal; - letter-spacing: 0.14em; - line-height: 1; - font-size: 1.5rem; - margin: 0.5em 0 0.74em; - padding: 0; - text-transform: uppercase; -} - -h1 { - letter-spacing: 0.03em; - line-height: 0.88; - margin: 0; - font-size: 3rem; - font-weight: bold; -} - -a { - text-align: center; - padding: 4rem; - padding-top: 0.5rem; - padding-bottom: 0.5rem; - border-radius: 10px; - border: none; - font-size: 1rem; - font-weight: bold; - text-transform: uppercase; -} - -button:hover { - background-position: right center; - color: white; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.html deleted file mode 100644 index 9e3609a67..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.js deleted file mode 100644 index fafdc061b..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.js +++ /dev/null @@ -1,27 +0,0 @@ -import { LightningElement, api, wire } from 'lwc'; -import getRecordInfo from '@salesforce/apex/ProductRecordInfoController.getRecordInfo'; - -/** - * Details component that is on top of the video. - */ -export default class HeroDetails extends LightningElement { - @api title = 'Hero Details'; // Default title to comply with accessibility - @api slogan; - @api recordName; - - recordInfoData; - hrefUrl; - - @wire(getRecordInfo, { productOrFamilyName: '$recordName' }) - recordInfo({ error, data }) { - this.recordInfoData = { error, data }; - // Temporary workaround so that clicking on button navigates every time - if (!error && data) { - if (data[1] === 'Product__c') { - this.hrefUrl = `product/${data[0]}`; - } else { - this.hrefUrl = `product-family/${data[0]}`; - } - } - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.js-meta.xml deleted file mode 100644 index fe23df019..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/heroDetails/heroDetails.js-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 52.0 - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/ldsUtils/__tests__/ldsUtils.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/ldsUtils/__tests__/ldsUtils.test.js deleted file mode 100644 index dfb398a3d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/ldsUtils/__tests__/ldsUtils.test.js +++ /dev/null @@ -1,61 +0,0 @@ -import { reduceErrors } from 'c/ldsUtils'; - -describe('c-lds-utils', () => { - describe('reduceErrors', () => { - it('reduces single error with message in body', () => { - const FULL_ERROR = { body: { message: 'mockError' } }; - const REDUCED_ERROR = [FULL_ERROR.body.message]; - - const reduced = reduceErrors(FULL_ERROR); - - expect(reduced).toStrictEqual(REDUCED_ERROR); - }); - - it('reduces single error with multiple bodies with messages', () => { - const FULL_ERROR = { - body: [{ message: 'mockError1' }, { message: 'mockError2' }] - }; - const REDUCED_ERROR = [ - FULL_ERROR.body[0].message, - FULL_ERROR.body[1].message - ]; - - const reduced = reduceErrors(FULL_ERROR); - - expect(reduced).toStrictEqual(REDUCED_ERROR); - }); - - it('reduces single error message string', () => { - const FULL_ERROR = { message: 'mockError' }; - const REDUCED_ERROR = [FULL_ERROR.message]; - - const reduced = reduceErrors(FULL_ERROR); - - expect(reduced).toStrictEqual(REDUCED_ERROR); - }); - - it('reduces array of error message string', () => { - const FULL_ERROR = [ - { message: 'mockError1' }, - { message: 'mockError2' } - ]; - const REDUCED_ERROR = [ - FULL_ERROR[0].message, - FULL_ERROR[1].message - ]; - - const reduced = reduceErrors(FULL_ERROR); - - expect(reduced).toStrictEqual(REDUCED_ERROR); - }); - - it('reduces single error with unknown shape', () => { - const FULL_ERROR = { statusText: 'mockStatus' }; - const REDUCED_ERROR = [FULL_ERROR.statusText]; - - const reduced = reduceErrors(FULL_ERROR); - - expect(reduced).toStrictEqual(REDUCED_ERROR); - }); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/ldsUtils/ldsUtils.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/ldsUtils/ldsUtils.js deleted file mode 100644 index 62afb19a8..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/ldsUtils/ldsUtils.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Reduces one or more LDS errors into a string[] of error messages. - * @param {FetchResponse|FetchResponse[]} errors - * @return {String[]} Error messages - */ -export function reduceErrors(errors) { - if (!Array.isArray(errors)) { - errors = [errors]; - } - - return ( - errors - // Remove null/undefined items - .filter((error) => !!error) - // Extract an error message - .map((error) => { - // UI API read errors - if (Array.isArray(error.body)) { - return error.body.map((e) => e.message); - } - // UI API DML, Apex and network errors - else if (error.body && typeof error.body.message === 'string') { - return error.body.message; - } - // JS errors - else if (typeof error.message === 'string') { - return error.message; - } - // Unknown error shape so try HTTP status text - return error.statusText; - }) - // Flatten - .reduce((prev, curr) => prev.concat(curr), []) - // Remove empty strings - .filter((message) => !!message) - ); -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/ldsUtils/ldsUtils.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/ldsUtils/ldsUtils.js-meta.xml deleted file mode 100644 index 26fe5f76c..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/ldsUtils/ldsUtils.js-meta.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - 52.0 - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/__tests__/data/getOrderItems.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/__tests__/data/getOrderItems.json deleted file mode 100644 index fcb54485d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/__tests__/data/getOrderItems.json +++ /dev/null @@ -1,50 +0,0 @@ -[ - { - "Id": "a003B000004fG1VQAU", - "Qty_S__c": 1, - "Qty_M__c": 1, - "Qty_L__c": 1, - "Price__c": 4200, - "Product__c": "a033B00000381hNQAQ", - "Product__r": { - "Name": "DYNAMO X1", - "MSRP__c": 7000, - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/dynamox1.jpg", - "Id": "a033B00000381hNQAQ", - "$serId$": 343 - }, - "$serId$": 342 - }, - { - "Id": "a003B000004fG1aQAE", - "Qty_S__c": 1, - "Qty_M__c": 1, - "Qty_L__c": 1, - "Price__c": 4320, - "Product__c": "a033B00000381hOQAQ", - "Product__r": { - "Name": "DYNAMO X2", - "MSRP__c": 7200, - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/dynamox2.jpg", - "Id": "a033B00000381hOQAQ", - "$serId$": 345 - }, - "$serId$": 344 - }, - { - "Id": "a003B000004fG1fQAE", - "Qty_S__c": 1, - "Qty_M__c": 1, - "Qty_L__c": 1, - "Price__c": 4440, - "Product__c": "a033B00000381hPQAQ", - "Product__r": { - "Name": "DYNAMO X3", - "MSRP__c": 7400, - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/dynamox3.jpg", - "Id": "a033B00000381hPQAQ", - "$serId$": 347 - }, - "$serId$": 346 - } -] diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/__tests__/data/getOrderItemsEmpty.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/__tests__/data/getOrderItemsEmpty.json deleted file mode 100644 index fe51488c7..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/__tests__/data/getOrderItemsEmpty.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/__tests__/orderBuilder.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/__tests__/orderBuilder.test.js deleted file mode 100644 index 45f40dd28..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/__tests__/orderBuilder.test.js +++ /dev/null @@ -1,268 +0,0 @@ -import { createElement } from 'lwc'; -import OrderBuilder from 'c/orderBuilder'; -import { registerApexTestWireAdapter } from '@salesforce/sfdx-lwc-jest'; -import getOrderItems from '@salesforce/apex/OrderController.getOrderItems'; - -// Mock realistic data for the getOrderItems adapter -const mockGetOrderItems = require('./data/getOrderItems.json'); -const mockGetOrderItemsEmpty = require('./data/getOrderItemsEmpty.json'); - -// Mock realistic data for the public properties -const mockRecordId = '0031700000pHcf8AAC'; - -//Expected Wire Input -const WIRE_INPUT = { - orderId: '0031700000pHcf8AAC' -}; - -// Register as Apex wire adapter. Some tests verify that provisioned values trigger desired behavior. -const getOrderItemsAdapter = registerApexTestWireAdapter(getOrderItems); - -describe('c-order-builder', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - }); - - it('displays the correct number of tiles and their details', () => { - // Set values for validating component changes - const expectedItems = 9; - const expectedSum = 38880; - - const element = createElement('c-order-builder', { - is: OrderBuilder - }); - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit Data from the Apex wire adapter. - getOrderItemsAdapter.emit(mockGetOrderItems); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Check the wire parameters are correct - expect(getOrderItemsAdapter.getLastConfig()).toEqual(WIRE_INPUT); - // Select elements for validation - const orderItemTileEl = - element.shadowRoot.querySelectorAll('c-order-item-tile'); - expect(orderItemTileEl.length).toBe(mockGetOrderItems.length); - // Get the order items to verify they have been set correctly - const { orderItem } = orderItemTileEl[0]; - expect(orderItem).toEqual( - expect.objectContaining(mockGetOrderItems[0]) - ); - // Get the formatted number to verify it has been calculated - const formattedNumberEl = element.shadowRoot.querySelector( - 'lightning-formatted-number' - ); - expect(formattedNumberEl.value).toBe(expectedSum); - // Get the order total to verify it has been calculated - const orderTotalDivEl = - element.shadowRoot.querySelector('div.right'); - expect(orderTotalDivEl.textContent).toBe( - `Total Items: ${expectedItems}` - ); - }); - }); - - it('updates the component when an order has been updated', () => { - // Set values for validating component changes - const mockRecordUpdate = { Id: 'a003B000004fG1VQAU', Qty_S__c: 3 }; - const expectedItems = 11; - const expectedSum = 47280; - - const element = createElement('c-order-builder', { - is: OrderBuilder - }); - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit Data from the Apex wire adapter.s - getOrderItemsAdapter.emit(mockGetOrderItems); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve() - .then(() => { - // Check the wire parameters are correct - expect(getOrderItemsAdapter.getLastConfig()).toEqual( - WIRE_INPUT - ); - // Select elements for validation - const orderItemTileEl = - element.shadowRoot.querySelectorAll('c-order-item-tile'); - orderItemTileEl[0].dispatchEvent( - new CustomEvent('orderitemchange', { - detail: mockRecordUpdate, - bubbles: true - }) - ); - }) - .then(() => { - const orderItemTileEl = - element.shadowRoot.querySelectorAll('c-order-item-tile'); - // Get the first order item and check that the quantity has ben updated - const orderItem = orderItemTileEl[0].orderItem.Qty_S__c; - expect(orderItem).toEqual(mockRecordUpdate.Qty_S__c); - // Get the formatted number to verify it has been updated - const formattedNumberEl = element.shadowRoot.querySelector( - 'lightning-formatted-number' - ); - expect(formattedNumberEl.value).toBe(expectedSum); - // Get the order total to verify it has been updated - const orderTotalDivEl = - element.shadowRoot.querySelector('div.right'); - expect(orderTotalDivEl.textContent).toBe( - `Total Items: ${expectedItems}` - ); - }); - }); - it('updates the component when an order has been deleted', () => { - // Set values for validating component changes - const mockRecordToDeleteId = 'a003B000004fG1VQAU'; - const expectedItems = 6; - const expectedSum = 26280; - - const element = createElement('c-order-builder', { - is: OrderBuilder - }); - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit Data from the Apex wire adapter. - getOrderItemsAdapter.emit(mockGetOrderItems); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve() - .then(() => { - // Check the wire parameters are correct - expect(getOrderItemsAdapter.getLastConfig()).toEqual( - WIRE_INPUT - ); - // Select elements for validation - const orderItemTileEl = - element.shadowRoot.querySelectorAll('c-order-item-tile'); - orderItemTileEl[0].dispatchEvent( - new CustomEvent('orderitemdelete', { - detail: { id: mockRecordToDeleteId } - }) - ); - }) - .then(() => { - const orderItemTileEl = - element.shadowRoot.querySelectorAll('c-order-item-tile'); - // Get the first order item and check that the quantity has ben updated - expect(orderItemTileEl.length).toBe( - mockGetOrderItems.length - 1 - ); - // Get the formatted number to verify it has been updated - const formattedNumberEl = element.shadowRoot.querySelector( - 'lightning-formatted-number' - ); - expect(formattedNumberEl.value).toBe(expectedSum); - // Get the order total to verify it has been updated - const orderTotalDivEl = - element.shadowRoot.querySelector('div.right'); - expect(orderTotalDivEl.textContent).toBe( - `Total Items: ${expectedItems}` - ); - }); - }); - - it('displays a panel when no data is returned', () => { - // Set values for validating component changes - const expectedMessage = 'Drag products here to add items to the order'; - - const element = createElement('c-order-builder', { - is: OrderBuilder - }); - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit Data from the Apex wire adapter. - getOrderItemsAdapter.emit(mockGetOrderItemsEmpty); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // verify that the placeholder is showing the correct data - const placeholderEl = - element.shadowRoot.querySelector('c-placeholder'); - expect(placeholderEl.message).toBe(expectedMessage); - }); - }); - - it('displays a error when an error is returned', () => { - // Set values for validating component changes - const mockError = { message: 'mockError' }; - - const element = createElement('c-order-builder', { - is: OrderBuilder - }); - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit Data from the Apex wire adapter. - getOrderItemsAdapter.error(mockError); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Verify that the error panel is showing the correct data - const errorPanelEl = - element.shadowRoot.querySelector('c-error-panel'); - expect(errorPanelEl).not.toBeNull(); - expect(errorPanelEl.errors.body).toStrictEqual(mockError); - }); - }); - - it('is accessible when orders returned', () => { - const element = createElement('c-order-builder', { - is: OrderBuilder - }); - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit Data from the Apex wire adapter. - getOrderItemsAdapter.emit(mockGetOrderItems); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); - - it('is accessible when no orders returned', () => { - const element = createElement('c-order-builder', { - is: OrderBuilder - }); - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit Data from the Apex wire adapter. - getOrderItemsAdapter.emit(mockGetOrderItemsEmpty); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); - - it('is accessible when error returned', () => { - const mockError = { message: 'mockError' }; - - const element = createElement('c-order-builder', { - is: OrderBuilder - }); - element.recordId = mockRecordId; - document.body.appendChild(element); - - // Emit Error from the Apex wire adapter. - getOrderItemsAdapter.error(mockError); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.css deleted file mode 100644 index 032c60018..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.css +++ /dev/null @@ -1,31 +0,0 @@ -header { - padding: 12px 16px; - background-color: rgba(194, 51, 53, 1); - color: #ffffff; - border-top-left-radius: 0.25rem; - border-top-right-radius: 0.25rem; - display: flex; -} - -header .right { - flex: 1; - text-align: right; -} - -.order-total { - margin-left: 4px; -} - -.drop-zone { - background: rgb(243, 242, 242); - display: flex; - flex-wrap: wrap; - border-bottom-left-radius: 0.25rem; - border-bottom-right-radius: 0.25rem; -} - -c-placeholder, -c-order-item-tile { - min-width: 250px; - flex: 1; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.html deleted file mode 100644 index 811bf5b6c..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.html +++ /dev/null @@ -1,42 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.js deleted file mode 100644 index b4a590149..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.js +++ /dev/null @@ -1,210 +0,0 @@ -import { LightningElement, wire, api } from 'lwc'; -import { ShowToastEvent } from 'lightning/platformShowToastEvent'; -import { reduceErrors } from 'c/ldsUtils'; - -/** Record DML operations. */ -import { - createRecord, - updateRecord, - deleteRecord -} from 'lightning/uiRecordApi'; - -/** Use Apex to fetch related records. */ -import { refreshApex, getSObjectValue } from '@salesforce/apex'; -import getOrderItems from '@salesforce/apex/OrderController.getOrderItems'; - -/** Order_Item__c Schema. */ -import ORDER_ITEM_OBJECT from '@salesforce/schema/Order_Item__c'; -import ORDER_FIELD from '@salesforce/schema/Order_Item__c.Order__c'; -import PRODUCT_FIELD from '@salesforce/schema/Order_Item__c.Product__c'; -import QTY_SMALL_FIELD from '@salesforce/schema/Order_Item__c.Qty_S__c'; -import QTY_MEDIUM_FIELD from '@salesforce/schema/Order_Item__c.Qty_M__c'; -import QTY_LARGE_FIELD from '@salesforce/schema/Order_Item__c.Qty_L__c'; -import PRICE_FIELD from '@salesforce/schema/Order_Item__c.Price__c'; - -/** Order_Item__c Schema. */ -import PRODUCT_MSRP_FIELD from '@salesforce/schema/Product__c.MSRP__c'; - -/** Discount for resellers. TODO - move to custom field on Account. */ -const DISCOUNT = 0.6; - -/** - * Gets the quantity of all items in an Order_Item__c SObject. - */ -function getQuantity(orderItem) { - return ( - getSObjectValue(orderItem, QTY_SMALL_FIELD) + - getSObjectValue(orderItem, QTY_MEDIUM_FIELD) + - getSObjectValue(orderItem, QTY_LARGE_FIELD) - ); -} - -/** - * Gets the price for the specified quantity of Order_Item__c SObject. - */ -function getPrice(orderItem, quantity) { - return getSObjectValue(orderItem, PRICE_FIELD) * quantity; -} - -/** - * Calculates the quantity and price of all Order_Item__c SObjects. - */ -function calculateOrderSummary(orderItems) { - const summary = orderItems.reduce( - (acc, orderItem) => { - const quantity = getQuantity(orderItem); - const price = getPrice(orderItem, quantity); - acc.quantity += quantity; - acc.price += price; - return acc; - }, - { quantity: 0, price: 0 } - ); - return summary; -} - -/** - * Builds Order__c by CRUD'ing the related Order_Item__c SObjects. - */ -export default class OrderBuilder extends LightningElement { - /** Id of Order__c SObject to display. */ - @api recordId; - - /** The Order_Item__c SObjects to display. */ - orderItems; - - /** Total price of the Order__c. Calculated from this.orderItems. */ - orderPrice = 0; - - /** Total quantity of the Order__c. Calculated from this.orderItems. */ - orderQuantity = 0; - - error; - - /** Wired Apex result so it may be programmatically refreshed. */ - wiredOrderItems; - - /** Apex load the Order__c's Order_Item_c[] and their related Product__c details. */ - @wire(getOrderItems, { orderId: '$recordId' }) - wiredGetOrderItems(value) { - this.wiredOrderItems = value; - if (value.error) { - this.error = value.error; - } else if (value.data) { - this.setOrderItems(value.data); - } - } - - /** Updates the order items, recalculating the order quantity and price. */ - setOrderItems(orderItems) { - this.orderItems = orderItems.slice(); - const summary = calculateOrderSummary(this.orderItems); - this.orderQuantity = summary.quantity; - this.orderPrice = summary.price; - } - - /** Handles drag-and-dropping a new product to create a new Order_Item__c. */ - handleDrop(event) { - event.preventDefault(); - // Product__c from LDS - const product = JSON.parse(event.dataTransfer.getData('product')); - - // build new Order_Item__c record - const fields = {}; - fields[ORDER_FIELD.fieldApiName] = this.recordId; - fields[PRODUCT_FIELD.fieldApiName] = product.Id; - fields[PRICE_FIELD.fieldApiName] = Math.round( - getSObjectValue(product, PRODUCT_MSRP_FIELD) * DISCOUNT - ); - - // create Order_Item__c record on server - const recordInput = { - apiName: ORDER_ITEM_OBJECT.objectApiName, - fields - }; - createRecord(recordInput) - .then(() => { - // refresh the Order_Item__c SObjects - return refreshApex(this.wiredOrderItems); - }) - .catch((e) => { - this.dispatchEvent( - new ShowToastEvent({ - title: 'Error creating order', - message: reduceErrors(e).join(', '), - variant: 'error' - }) - ); - }); - } - - /** Handles for dragging events. */ - handleDragOver(event) { - event.preventDefault(); - } - - /** Handles event to change Order_Item__c details. */ - handleOrderItemChange(evt) { - const orderItemChanges = evt.detail; - - // optimistically make the change on the client - const previousOrderItems = this.orderItems; - const orderItems = this.orderItems.map((orderItem) => { - if (orderItem.Id === orderItemChanges.Id) { - // synthesize a new Order_Item__c SObject - return Object.assign({}, orderItem, orderItemChanges); - } - return orderItem; - }); - this.setOrderItems(orderItems); - - // update Order_Item__c on the server - const recordInput = { fields: orderItemChanges }; - updateRecord(recordInput) - .then(() => { - // if there were triggers/etc that invalidate the Apex result then we'd refresh it - // return refreshApex(this.wiredOrderItems); - }) - .catch((e) => { - // error updating server so rollback to previous data - this.setOrderItems(previousOrderItems); - this.dispatchEvent( - new ShowToastEvent({ - title: 'Error updating order item', - message: reduceErrors(e).join(', '), - variant: 'error' - }) - ); - }); - } - - /** Handles event to delete Order_Item__c. */ - handleOrderItemDelete(evt) { - const id = evt.detail.id; - - // optimistically make the change on the client - const previousOrderItems = this.orderItems; - const orderItems = this.orderItems.filter( - (orderItem) => orderItem.Id !== id - ); - this.setOrderItems(orderItems); - - // delete Order_Item__c SObject on the server - deleteRecord(id) - .then(() => { - // if there were triggers/etc that invalidate the Apex result then we'd refresh it - // return refreshApex(this.wiredOrderItems); - }) - .catch((e) => { - // error updating server so rollback to previous data - this.setOrderItems(previousOrderItems); - this.dispatchEvent( - new ShowToastEvent({ - title: 'Error deleting order item', - message: reduceErrors(e).join(', '), - variant: 'error' - }) - ); - }); - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.js-meta.xml deleted file mode 100644 index 78a21c121..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderBuilder/orderBuilder.js-meta.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 52.0 - true - Order Builder - - lightning__AppPage - lightning__RecordPage - lightning__HomePage - lightningCommunity__Page - lightningCommunity__Default - - - - - Order__c - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.css deleted file mode 100644 index 55ecdd5be..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.css +++ /dev/null @@ -1,47 +0,0 @@ -.content { - padding: 8px 8px 12px 8px; - background-color: #ffffff; - position: relative; - border-radius: 0.25rem; -} - -img.product { - height: 120px; - max-width: initial; -} - -.title { - font-weight: bold; - text-transform: uppercase; -} - -.quantity { - width: 58px; - margin: 0 2px; -} - -.price { - width: 94px; - margin: 0 2px; -} - -.form { - display: flex; -} - -.save-button { - position: absolute; - top: 10px; - right: 10px; -} - -.delete-button { - position: absolute; - top: 10px; - left: 10px; - display: none; -} - -.content:hover .delete-button { - display: inherit; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.html deleted file mode 100644 index f18c20268..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.html +++ /dev/null @@ -1,76 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.js deleted file mode 100644 index 933aa3fe6..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.js +++ /dev/null @@ -1,48 +0,0 @@ -import { LightningElement, api } from 'lwc'; - -/** - * Displays an Order_Item__c SObject. Note that this component does not use schema imports and uses dynamic - * references to the schema instead. For example, orderItem.Price__c (see template). The dynamic approach is - * less verbose but does not provide referential integrity. The schema imports approach is more verbose but - * enforces referential integrity: 1) The existence of the fields you reference is checked at compile time. - * 2) Fields that are statically imported in a component cannot be deleted in the object model. - */ -export default class OrderItemTile extends LightningElement { - /** Order_Item__c SObject to display. */ - @api orderItem; - - /** Whether the component has unsaved changes. */ - isModified = false; - - /** Mutated/unsaved Order_Item__c values. */ - form = {}; - - /** Handles form input. */ - handleFormChange(evt) { - this.isModified = true; - const field = evt.target.dataset.fieldName; - let value = parseInt(evt.detail.value.trim(), 10); - if (!Number.isInteger(value)) { - value = 0; - } - this.form[field] = value; - } - - /** Fires event to update the Order_Item__c SObject. */ - - saveOrderItem() { - const event = new CustomEvent('orderitemchange', { - detail: Object.assign({}, { Id: this.orderItem.Id }, this.form) - }); - this.dispatchEvent(event); - this.isModified = false; - } - - /** Fires event to delete the Order_Item__c SObject. */ - deleteOrderItem() { - const event = new CustomEvent('orderitemdelete', { - detail: { id: this.orderItem.Id } - }); - this.dispatchEvent(event); - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.js-meta.xml deleted file mode 100644 index fe23df019..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/orderItemTile/orderItemTile.js-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 52.0 - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/__tests__/paginator.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/__tests__/paginator.test.js deleted file mode 100644 index 32436183e..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/__tests__/paginator.test.js +++ /dev/null @@ -1,124 +0,0 @@ -import { createElement } from 'lwc'; -import Paginator from 'c/paginator'; - -describe('c-paginator', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - }); - - it('sends "next" event on button click', () => { - // Create initial element - const element = createElement('c-paginator', { - is: Paginator - }); - document.body.appendChild(element); - - // Mock handlers for child events - const handlerNext = jest.fn(); - - // Add event listener to catch child events - element.addEventListener('next', handlerNext); - - // Click the next(>) button - const nextButtonEl = element.shadowRoot.querySelector('.next'); - nextButtonEl.click(); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Validate if mocked events got fired - expect(handlerNext.mock.calls.length).toBe(1); - }); - }); - - it('sends "previous" event on button click', () => { - // Create initial element - const element = createElement('c-paginator', { - is: Paginator - }); - document.body.appendChild(element); - - // Mock handlers for child events - const handlerPrevious = jest.fn(); - - // Add event listener to catch child events - element.addEventListener('previous', handlerPrevious); - - // Click the Previous(<) button - const prevButtonEl = element.shadowRoot.querySelector('.previous'); - prevButtonEl.click(); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Validate if mocked events got fired - expect(handlerPrevious.mock.calls.length).toBe(1); - }); - }); - - it('displays total item count, page number, and number of pages with zero items', () => { - // Create initial element - const element = createElement('c-paginator', { - is: Paginator - }); - //Set the public property values - element.pageNumber = 0; - element.pageSize = 9; - element.totalItemCount = 0; - - document.body.appendChild(element); - - // Query div for validating the display message on component init - const lightningLayoutItemEl = - element.shadowRoot.querySelector('.nav-info'); - //Check for the 0 items message - expect(lightningLayoutItemEl).not.toBeNull(); - expect(lightningLayoutItemEl.textContent).toBe('0 items • page 0 of 0'); - }); - - it('displays total item count, page number, and number of pages with some items', () => { - // Create initial element - const element = createElement('c-paginator', { - is: Paginator - }); - document.body.appendChild(element); - - //Set the public properties for item count greater than zero - element.pageNumber = 1; - element.pageSize = 9; - element.totalItemCount = 12; - - // Query div for validating the display message on component init - const lightningLayoutItemEl = - element.shadowRoot.querySelector('.nav-info'); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Query div for validating computed style attribute value on public property change - expect(lightningLayoutItemEl).not.toBeNull(); - expect(lightningLayoutItemEl.textContent).toBe( - '12 items • page 1 of 2' - ); - }); - }); - - it('is accessible', () => { - const element = createElement('c-paginator', { - is: Paginator - }); - - element.pageNumber = 3; - element.pageSize = 9; - element.totalItemCount = 12; - document.body.appendChild(element); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.css deleted file mode 100644 index 1fff2b154..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.css +++ /dev/null @@ -1,8 +0,0 @@ -.nav-info { - text-align: center; -} - -.nav-next { - text-align: right; - height: 32px; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.html deleted file mode 100644 index 9c105800f..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.html +++ /dev/null @@ -1,28 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.js deleted file mode 100644 index 84ffb3e21..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.js +++ /dev/null @@ -1,36 +0,0 @@ -import { LightningElement, api } from 'lwc'; - -export default class Paginator extends LightningElement { - /** The current page number. */ - @api pageNumber; - - /** The number of items on a page. */ - @api pageSize; - - /** The total number of items in the list. */ - @api totalItemCount; - - handlePrevious() { - this.dispatchEvent(new CustomEvent('previous')); - } - - handleNext() { - this.dispatchEvent(new CustomEvent('next')); - } - - get currentPageNumber() { - return this.totalItemCount === 0 ? 0 : this.pageNumber; - } - - get isFirstPage() { - return this.pageNumber === 1; - } - - get isLastPage() { - return this.pageNumber >= this.totalPages; - } - - get totalPages() { - return Math.ceil(this.totalItemCount / this.pageSize); - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.js-meta.xml deleted file mode 100644 index fe23df019..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/paginator/paginator.js-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 52.0 - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/__tests__/placeholder.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/__tests__/placeholder.test.js deleted file mode 100644 index 817bc51cc..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/__tests__/placeholder.test.js +++ /dev/null @@ -1,32 +0,0 @@ -import { createElement } from 'lwc'; -import Placeholder from 'c/placeholder'; - -describe('c-placeholder', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - }); - - it('sets img url to be bike_assets resource', () => { - const element = createElement('c-placeholder', { - is: Placeholder - }); - document.body.appendChild(element); - const img = element.shadowRoot.querySelector('img'); - // By default @salesforce/sfdx-lwc-jest resolves the - // @salesforce/resourceUrl/bike_assets import to "bike_assets" - expect(img.src).toMatch(/\/bike_assets\//); - }); - - it('is accessible', () => { - const element = createElement('c-placeholder', { - is: Placeholder - }); - - document.body.appendChild(element); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.css deleted file mode 100644 index 56bf2bd05..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.css +++ /dev/null @@ -1,8 +0,0 @@ -:host > div { - text-align: center; - color: #c23335; -} - -img { - height: 70px; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.html deleted file mode 100644 index 7ce8fd6de..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.html +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.js deleted file mode 100644 index f834180e6..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.js +++ /dev/null @@ -1,11 +0,0 @@ -import { LightningElement, api } from 'lwc'; - -/** Static Resources. */ -import BIKE_ASSETS_URL from '@salesforce/resourceUrl/bike_assets'; - -export default class Placeholder extends LightningElement { - @api message; - - /** Url for bike logo. */ - logoUrl = `${BIKE_ASSETS_URL}/logo.svg`; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.js-meta.xml deleted file mode 100644 index fe23df019..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/placeholder/placeholder.js-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 52.0 - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.css deleted file mode 100644 index f85e10213..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.css +++ /dev/null @@ -1,11 +0,0 @@ -img.product { - width: 100%; - margin-bottom: 0.5rem; -} - -section { - font-weight: bold; - font-size: 0.85rem; - margin-top: 0.75rem; - text-transform: uppercase; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.html deleted file mode 100644 index 9dca5851b..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.html +++ /dev/null @@ -1,82 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.js deleted file mode 100644 index bd8903649..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.js +++ /dev/null @@ -1,89 +0,0 @@ -import { LightningElement, wire } from 'lwc'; - -// Lightning Message Service and a message channel -import { NavigationMixin } from 'lightning/navigation'; -import { subscribe, MessageContext } from 'lightning/messageService'; -import PRODUCT_SELECTED_MESSAGE from '@salesforce/messageChannel/ProductSelected__c'; - -// Utils to extract field values -import { getFieldValue } from 'lightning/uiRecordApi'; - -// Product__c Schema -import PRODUCT_OBJECT from '@salesforce/schema/Product__c'; -import NAME_FIELD from '@salesforce/schema/Product__c.Name'; -import PICTURE_URL_FIELD from '@salesforce/schema/Product__c.Picture_URL__c'; -import CATEGORY_FIELD from '@salesforce/schema/Product__c.Category__c'; -import LEVEL_FIELD from '@salesforce/schema/Product__c.Level__c'; -import MSRP_FIELD from '@salesforce/schema/Product__c.MSRP__c'; -import BATTERY_FIELD from '@salesforce/schema/Product__c.Battery__c'; -import CHARGER_FIELD from '@salesforce/schema/Product__c.Charger__c'; -import MOTOR_FIELD from '@salesforce/schema/Product__c.Motor__c'; -import MATERIAL_FIELD from '@salesforce/schema/Product__c.Material__c'; -import FOPK_FIELD from '@salesforce/schema/Product__c.Fork__c'; -import FRONT_BRAKES_FIELD from '@salesforce/schema/Product__c.Front_Brakes__c'; -import REAR_BRAKES_FIELD from '@salesforce/schema/Product__c.Rear_Brakes__c'; - -/** - * Component to display details of a Product__c. - */ -export default class ProductCard extends NavigationMixin(LightningElement) { - // Exposing fields to make them available in the template - categoryField = CATEGORY_FIELD; - levelField = LEVEL_FIELD; - msrpField = MSRP_FIELD; - batteryField = BATTERY_FIELD; - chargerField = CHARGER_FIELD; - motorField = MOTOR_FIELD; - materialField = MATERIAL_FIELD; - forkField = FOPK_FIELD; - frontBrakesField = FRONT_BRAKES_FIELD; - rearBrakesField = REAR_BRAKES_FIELD; - - // Id of Product__c to display - recordId; - - // Product fields displayed with specific format - productName; - productPictureUrl; - - /** Load context for Lightning Messaging Service */ - @wire(MessageContext) messageContext; - - /** Subscription for ProductSelected Lightning message */ - productSelectionSubscription; - - connectedCallback() { - // Subscribe to ProductSelected message - this.productSelectionSubscription = subscribe( - this.messageContext, - PRODUCT_SELECTED_MESSAGE, - (message) => this.handleProductSelected(message.productId) - ); - } - - handleRecordLoaded(event) { - const { records } = event.detail; - const recordData = records[this.recordId]; - this.productName = getFieldValue(recordData, NAME_FIELD); - this.productPictureUrl = getFieldValue(recordData, PICTURE_URL_FIELD); - } - - /** - * Handler for when a product is selected. When `this.recordId` changes, the - * lightning-record-view-form component will detect the change and provision new data. - */ - handleProductSelected(productId) { - this.recordId = productId; - } - - handleNavigateToRecord() { - this[NavigationMixin.Navigate]({ - type: 'standard__recordPage', - attributes: { - recordId: this.recordId, - objectApiName: PRODUCT_OBJECT.objectApiName, - actionName: 'view' - } - }); - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.js-meta.xml deleted file mode 100644 index 83f19b6bf..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productCard/productCard.js-meta.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - 52.0 - true - Product Card - - lightning__AppPage - lightning__RecordPage - lightning__HomePage - lightningCommunity__Page - - - - - Product__c - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/__tests__/data/getPicklistValues.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/__tests__/data/getPicklistValues.json deleted file mode 100644 index b3868a1ad..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/__tests__/data/getPicklistValues.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "controllerValues": {}, - "defaultValue": null, - "eTag": "57e25eb0b5ecf048c873387bdbd07b80", - "url": "/services/data/v49.0/ui-api/object-info/Product__c/picklist-values/012000000000000AAA/Category__c", - "values": [ - { - "attributes": null, - "label": "MockValue", - "validFor": [], - "value": "MockValue" - } - ] -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/__tests__/productFilter.accessibility.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/__tests__/productFilter.accessibility.test.js deleted file mode 100644 index 66148bd60..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/__tests__/productFilter.accessibility.test.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Accessibility tests reside in a different test file in this case - * because there's an open issue on jest (https://github.com/facebook/jest/issues/8726) - * because of which fake timers leak into all the tests in the same file, - * while Axe doen't work when using fake timers. - **/ -import { createElement } from 'lwc'; -import ProductFilter from 'c/productFilter'; -import { - registerLdsTestWireAdapter, - registerTestWireAdapter -} from '@salesforce/sfdx-lwc-jest'; -import { getPicklistValues } from 'lightning/uiObjectInfoApi'; -import { MessageContext } from 'lightning/messageService'; - -/* - * Import a snapshot of getPicklistValues' response for functional verification. This eliminates - * the need to connect to an org to retrieve data, which allows for running all unit tests - * on localhost (aka offline). - * - * This data can be captured using a REST client accessing the UI API resource which the - * @wire(getPicklistValues) represents: - * /ui-api/object-info/{objectApiName}/picklist-values/{recordTypeId}/{fieldApiName} - * Documentation for this UI API resource is at - * https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_picklist_values.htm - * - * Community-provided instructions for access Salesforce REST resources is at - * https://blog.mkorman.uk/using-postman-to-explore-salesforce-restful-web-services/ - */ -const mockGetPicklistValues = require('./data/getPicklistValues.json'); - -// Register as an LDS wire adapter. Some tests verify the provisioned values trigger desired behavior. -const getPicklistValuesAdapter = registerLdsTestWireAdapter(getPicklistValues); - -// Register as a standard wire adapter because the component under test requires this adapter. -// We don't exercise this wire adapter in the tests. -registerTestWireAdapter(MessageContext); - -describe('c-product-filter-accessibility', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - // Prevent data saved on mocks from leaking between tests - jest.clearAllMocks(); - }); - it('is accessible when picklist values returned', () => { - const element = createElement('c-product-filter', { - is: ProductFilter - }); - document.body.appendChild(element); - - getPicklistValuesAdapter.emit(mockGetPicklistValues); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); - - it('is accessible when error returned', () => { - const element = createElement('c-product-filter', { - is: ProductFilter - }); - document.body.appendChild(element); - - getPicklistValuesAdapter.error(); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/__tests__/productFilter.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/__tests__/productFilter.test.js deleted file mode 100644 index 23e34fe90..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/__tests__/productFilter.test.js +++ /dev/null @@ -1,196 +0,0 @@ -import { createElement } from 'lwc'; -import ProductFilter from 'c/productFilter'; -import { - registerLdsTestWireAdapter, - registerTestWireAdapter -} from '@salesforce/sfdx-lwc-jest'; -import { getPicklistValues } from 'lightning/uiObjectInfoApi'; -import { publish, MessageContext } from 'lightning/messageService'; -import PRODUCTS_FILTERED_MESSAGE from '@salesforce/messageChannel/ProductsFiltered__c'; - -/* - * Import a snapshot of getPicklistValues' response for functional verification. This eliminates - * the need to connect to an org to retrieve data, which allows for running all unit tests - * on localhost (aka offline). - * - * This data can be captured using a REST client accessing the UI API resource which the - * @wire(getPicklistValues) represents: - * /ui-api/object-info/{objectApiName}/picklist-values/{recordTypeId}/{fieldApiName} - * Documentation for this UI API resource is at - * https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_picklist_values.htm - * - * Community-provided instructions for access Salesforce REST resources is at - * https://blog.mkorman.uk/using-postman-to-explore-salesforce-restful-web-services/ - */ -const mockGetPicklistValues = require('./data/getPicklistValues.json'); - -// Register as an LDS wire adapter. Some tests verify the provisioned values trigger desired behavior. -const getPicklistValuesAdapter = registerLdsTestWireAdapter(getPicklistValues); - -// Register as a standard wire adapter because the component under test requires this adapter. -// We don't exercise this wire adapter in the tests. -registerTestWireAdapter(MessageContext); - -describe('c-product-filter', () => { - beforeEach(() => { - // Reset timer mocks - jest.useFakeTimers(); - }); - - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - // Prevent data saved on mocks from leaking between tests - jest.clearAllMocks(); - }); - - describe('filterChange event', () => { - it('sends message when slider value changes', () => { - const expectedPrice = 500; - const element = createElement('c-product-filter', { - is: ProductFilter - }); - document.body.appendChild(element); - - const slider = element.shadowRoot.querySelector('lightning-slider'); - slider.value = expectedPrice; - slider.dispatchEvent(new CustomEvent('change')); - // Run timers eg setTimeout() - jest.runAllTimers(); - - // Only verify the relevant params - const expectedFilters = { - filters: { - maxPrice: expectedPrice, - searchKey: expect.any(String) - } - }; - expect(publish).toHaveBeenCalledWith( - undefined, - PRODUCTS_FILTERED_MESSAGE, - expect.objectContaining(expectedFilters) - ); - }); - - it('sends message when search value changes', () => { - const expectedSearchKey = 'search string'; - const element = createElement('c-product-filter', { - is: ProductFilter - }); - document.body.appendChild(element); - - const searchInput = - element.shadowRoot.querySelector('lightning-input'); - searchInput.value = expectedSearchKey; - searchInput.dispatchEvent(new CustomEvent('change')); - // Run timers eg setTimeout() - jest.runAllTimers(); - - // Only verify the relevant params - const expectedFilters = { - filters: { - maxPrice: expect.any(Number), - searchKey: expectedSearchKey - } - }; - expect(publish).toHaveBeenCalledWith( - undefined, - PRODUCTS_FILTERED_MESSAGE, - expect.objectContaining(expectedFilters) - ); - }); - - // eslint-disable-next-line jest/expect-expect - it('sends messages when checkbox are toggled', () => { - const element = createElement('c-product-filter', { - is: ProductFilter - }); - document.body.appendChild(element); - - getPicklistValuesAdapter.emit(mockGetPicklistValues); - - // Prepare expected filter values with default filters - const expectedFilters = { - filters: { - categories: ['MockValue'], - levels: ['MockValue'], - materials: ['MockValue'], - maxPrice: 10000, - searchKey: '' - } - }; - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise ends in the - // rejected state - return Promise.resolve() - .then(() => { - expectedFilters.filters.categories = []; - verifyFilterToggle(element, 'categories', expectedFilters); - }) - .then(() => { - expectedFilters.filters.materials = []; - verifyFilterToggle(element, 'materials', expectedFilters); - }) - .then(() => { - expectedFilters.filters.levels = []; - verifyFilterToggle(element, 'levels', expectedFilters); - }); - }); - - function verifyFilterToggle(element, filterName, expectedFilters) { - const checkbox = element.shadowRoot.querySelector( - `[data-filter="${filterName}"]` - ); - checkbox.checked = false; - checkbox.dispatchEvent(new CustomEvent('change')); - // Filters are initialized to include all values emitted by getPicklistValuesAdapter, which is one item - // per filter. Toggling it results in that filter being empty. - expect(publish).toHaveBeenCalledWith( - undefined, - PRODUCTS_FILTERED_MESSAGE, - expect.objectContaining(expectedFilters) - ); - } - }); - - describe('getPicklistValues @wire error', () => { - it('shows error message elements', () => { - const element = createElement('c-product-filter', { - is: ProductFilter - }); - document.body.appendChild(element); - - getPicklistValuesAdapter.error(); - - return Promise.resolve().then(() => { - const messages = - element.shadowRoot.querySelectorAll('c-error-panel'); - // One error message per @wire - expect(messages).toHaveLength(3); - }); - }); - - it.each(['categories', 'materials', 'levels'])( - 'does not render %s input options', - (type) => { - const element = createElement('c-product-filter', { - is: ProductFilter - }); - document.body.appendChild(element); - - getPicklistValuesAdapter.error(); - - return Promise.resolve().then(() => { - const input = element.shadowRoot.querySelector( - `[data-filter="${type}"]` - ); - expect(input).toBeNull(); - }); - } - ); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.css deleted file mode 100644 index 2c9f94f37..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.css +++ /dev/null @@ -1,8 +0,0 @@ -section { - margin-top: 16px; -} - -section > h1 { - font-weight: bold; - text-transform: uppercase; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.html deleted file mode 100644 index f03cb2875..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.html +++ /dev/null @@ -1,96 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.js deleted file mode 100644 index a6bb55e96..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.js +++ /dev/null @@ -1,103 +0,0 @@ -import { LightningElement, wire } from 'lwc'; -import { getPicklistValues } from 'lightning/uiObjectInfoApi'; - -// Product schema -import CATEGORY_FIELD from '@salesforce/schema/Product__c.Category__c'; -import LEVEL_FIELD from '@salesforce/schema/Product__c.Level__c'; -import MATERIAL_FIELD from '@salesforce/schema/Product__c.Material__c'; - -// Lightning Message Service and a message channel -import { publish, MessageContext } from 'lightning/messageService'; -import PRODUCTS_FILTERED_MESSAGE from '@salesforce/messageChannel/ProductsFiltered__c'; - -// The delay used when debouncing event handlers before firing the event -const DELAY = 350; - -/** - * Displays a filter panel to search for Product__c[]. - */ -export default class ProductFilter extends LightningElement { - searchKey = ''; - maxPrice = 10000; - - filters = { - searchKey: '', - maxPrice: 10000 - }; - - @wire(MessageContext) - messageContext; - - @wire(getPicklistValues, { - recordTypeId: '012000000000000AAA', - fieldApiName: CATEGORY_FIELD - }) - categories; - - @wire(getPicklistValues, { - recordTypeId: '012000000000000AAA', - fieldApiName: LEVEL_FIELD - }) - levels; - - @wire(getPicklistValues, { - recordTypeId: '012000000000000AAA', - fieldApiName: MATERIAL_FIELD - }) - materials; - - handleSearchKeyChange(event) { - this.filters.searchKey = event.target.value; - this.delayedFireFilterChangeEvent(); - } - - handleMaxPriceChange(event) { - const maxPrice = event.target.value; - this.filters.maxPrice = maxPrice; - this.delayedFireFilterChangeEvent(); - } - - handleCheckboxChange(event) { - if (!this.filters.categories) { - // Lazy initialize filters with all values initially set - this.filters.categories = this.categories.data.values.map( - (item) => item.value - ); - this.filters.levels = this.levels.data.values.map( - (item) => item.value - ); - this.filters.materials = this.materials.data.values.map( - (item) => item.value - ); - } - const value = event.target.dataset.value; - const filterArray = this.filters[event.target.dataset.filter]; - if (event.target.checked) { - if (!filterArray.includes(value)) { - filterArray.push(value); - } - } else { - this.filters[event.target.dataset.filter] = filterArray.filter( - (item) => item !== value - ); - } - // Published ProductsFiltered message - publish(this.messageContext, PRODUCTS_FILTERED_MESSAGE, { - filters: this.filters - }); - } - - delayedFireFilterChangeEvent() { - // Debouncing this method: Do not actually fire the event as long as this function is - // being called within a delay of DELAY. This is to avoid a very large number of Apex - // method calls in components listening to this event. - window.clearTimeout(this.delayTimeout); - // eslint-disable-next-line @lwc/lwc/no-async-operation - this.delayTimeout = setTimeout(() => { - // Published ProductsFiltered message - publish(this.messageContext, PRODUCTS_FILTERED_MESSAGE, { - filters: this.filters - }); - }, DELAY); - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.js-meta.xml deleted file mode 100644 index 4297a7f80..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productFilter/productFilter.js-meta.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - 52.0 - true - Product Filter - - lightning__AppPage - lightning__HomePage - lightningCommunity__Page - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/__tests__/productListItem.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/__tests__/productListItem.test.js deleted file mode 100644 index 574aff507..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/__tests__/productListItem.test.js +++ /dev/null @@ -1,52 +0,0 @@ -import { createElement } from 'lwc'; -import ProductListItem from 'c/productListItem'; -import { getNavigateCalledWith } from 'lightning/navigation'; - -describe('c-product-list-item', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - }); - - it('navigates to record page when View Details button clicked', () => { - const expectedId = 'expectedId'; - const element = createElement('c-product-list-item', { - is: ProductListItem - }); - element.product = { - Id: expectedId, - Picture_URL__c: 'https://salesforce.com', - Name: 'Foo', - MSRP__c: 1000 - }; - document.body.appendChild(element); - - const lightningButton = - element.shadowRoot.querySelector('lightning-button'); - lightningButton.click(); - - const { pageReference } = getNavigateCalledWith(); - // Verify the component under test called the correct navigate event - // type and sent the expected recordId defined above - expect(pageReference.type).toBe('standard__recordPage'); - expect(pageReference.attributes.recordId).toBe(expectedId); - }); - - it('is accessible', () => { - const element = createElement('c-product-list-item', { - is: ProductListItem - }); - - element.product = { - Id: 'expectedId', - Picture_URL__c: 'https://salesforce.com', - Name: 'Foo', - MSRP__c: 1000 - }; - document.body.appendChild(element); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.css deleted file mode 100644 index 21993b5f7..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.css +++ /dev/null @@ -1,5 +0,0 @@ -img.product { - height: 80px; - max-width: initial; - pointer-events: none; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.html deleted file mode 100644 index ac28c7029..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.html +++ /dev/null @@ -1,31 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.js deleted file mode 100644 index a0460e316..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.js +++ /dev/null @@ -1,23 +0,0 @@ -import { LightningElement, api } from 'lwc'; -import { NavigationMixin } from 'lightning/navigation'; -import PRODUCT_OBJECT from '@salesforce/schema/Product__c'; - -/** - * A presentation component to display a Product__c sObject. The provided - * Product__c data must contain all fields used by this component. - */ -export default class ProductListItem extends NavigationMixin(LightningElement) { - @api product; - - /** View Details Handler to navigates to the record page */ - handleViewDetailsClick() { - this[NavigationMixin.Navigate]({ - type: 'standard__recordPage', - attributes: { - recordId: this.product.Id, - objectApiName: PRODUCT_OBJECT.objectApiName, - actionName: 'view' - } - }); - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.js-meta.xml deleted file mode 100644 index fe23df019..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productListItem/productListItem.js-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 52.0 - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/__tests__/productTile.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/__tests__/productTile.test.js deleted file mode 100644 index da9fae19f..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/__tests__/productTile.test.js +++ /dev/null @@ -1,74 +0,0 @@ -import { createElement } from 'lwc'; -import ProductTile from 'c/productTile'; - -describe('c-product-tile', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - }); - - it('dragging sets product as dataTransfer data', () => { - const element = createElement('c-product-tile', { - is: ProductTile - }); - // Emulate a DragEvent, jsdom does not implement this class yet - const dragstartEvent = new CustomEvent('dragstart'); - dragstartEvent.dataTransfer = { - setData: jest.fn() - }; - const product = { - Id: 1, - Picture_URL__c: 'https://salesforce.com', - Name: 'Foo', - MSRP__c: 1000 - }; - element.product = product; - document.body.appendChild(element); - - const div = element.shadowRoot.querySelector('div'); - div.dispatchEvent(dragstartEvent); - - expect(dragstartEvent.dataTransfer.setData).toHaveBeenCalledWith( - 'product', - JSON.stringify(product) - ); - }); - - it('clicking fires selected event', () => { - const listener = jest.fn(); - const element = createElement('c-product-tile', { - is: ProductTile - }); - element.addEventListener('selected', listener); - element.product = { - Id: 1, - Picture_URL__c: 'https://salesforce.com', - Name: 'Foo', - MSRP__c: 1000 - }; - document.body.appendChild(element); - - const anchor = element.shadowRoot.querySelector('a'); - anchor.click(); - - expect(listener).toHaveBeenCalled(); - }); - - it('is accessible', () => { - const element = createElement('c-product-tile', { - is: ProductTile - }); - - element.product = { - Id: 1, - Picture_URL__c: 'https://salesforce.com', - Name: 'Foo', - MSRP__c: 1000 - }; - document.body.appendChild(element); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.css deleted file mode 100644 index 10d11eaea..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.css +++ /dev/null @@ -1,20 +0,0 @@ -.content { - padding: 8px; - background-color: #ffffff; - border-radius: 0.25rem; -} - -a { - color: inherit; -} - -img.product { - height: 120px; - max-width: initial; - pointer-events: none; -} - -.title { - font-weight: bold; - text-transform: uppercase; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.html deleted file mode 100644 index 50bb54d5c..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.html +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.js deleted file mode 100644 index 4e3d3c460..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.js +++ /dev/null @@ -1,39 +0,0 @@ -import { LightningElement, api } from 'lwc'; - -/** - * A presentation component to display a Product__c sObject. The provided - * Product__c data must contain all fields used by this component. - */ -export default class ProductTile extends LightningElement { - /** Whether the tile is draggable. */ - @api draggable; - - _product; - /** Product__c to display. */ - @api - get product() { - return this._product; - } - set product(value) { - this._product = value; - this.pictureUrl = value.Picture_URL__c; - this.name = value.Name; - this.msrp = value.MSRP__c; - } - - /** Product__c field values to display. */ - pictureUrl; - name; - msrp; - - handleClick() { - const selectedEvent = new CustomEvent('selected', { - detail: this.product.Id - }); - this.dispatchEvent(selectedEvent); - } - - handleDragStart(event) { - event.dataTransfer.setData('product', JSON.stringify(this.product)); - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.js-meta.xml deleted file mode 100644 index 1b6f36a99..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTile/productTile.js-meta.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 52.0 - true - Product Tile - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/__tests__/data/getProducts.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/__tests__/data/getProducts.json deleted file mode 100644 index fd336d8d2..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/__tests__/data/getProducts.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "pageNumber": 1, - "pageSize": 9, - "totalItemCount": 12, - "records": [ - { - "Id": "a039A000000lqLbQAI", - "Name": "DYNAMO X1", - "MSRP__c": 7000, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Mountain", - "Level__c": "Racer", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/dynamox1.jpg", - "Material__c": "Carbon" - }, - { - "Id": "a039A000000lqLcQAI", - "Name": "DYNAMO X2", - "MSRP__c": 7200, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Mountain", - "Level__c": "Racer", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/dynamox2.jpg", - "Material__c": "Carbon" - }, - { - "Id": "a039A000000lqLdQAI", - "Name": "DYNAMO X3", - "MSRP__c": 7400, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Mountain", - "Level__c": "Racer", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/dynamox3.jpg", - "Material__c": "Carbon" - }, - { - "Id": "a039A000000lqLeQAI", - "Name": "DYNAMO X4", - "MSRP__c": 7800, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Mountain", - "Level__c": "Racer", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/dynamox4.jpg", - "Material__c": "Carbon" - }, - { - "Id": "a039A000000lqLfQAI", - "Name": "ELECTRA X1", - "MSRP__c": 4000, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Mountain", - "Level__c": "Enthusiast", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/electrax1.jpg", - "Material__c": "Aluminum" - }, - { - "Id": "a039A000000lqLgQAI", - "Name": "ELECTRA X2", - "MSRP__c": 4300, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Mountain", - "Level__c": "Enthusiast", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/electrax2.jpg", - "Material__c": "Aluminum" - }, - { - "Id": "a039A000000lqLhQAI", - "Name": "ELECTRA X3", - "MSRP__c": 4600, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Mountain", - "Level__c": "Enthusiast", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/electrax3.jpg", - "Material__c": "Aluminum" - }, - { - "Id": "a039A000000lqLiQAI", - "Name": "ELECTRA X4", - "MSRP__c": 4900, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Mountain", - "Level__c": "Enthusiast", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/electrax4.jpg", - "Material__c": "Aluminum" - }, - { - "Id": "a039A000000lqLXQAY", - "Name": "FUSE X1", - "MSRP__c": 2500, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Commuter", - "Level__c": "Beginner", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/fusex1.jpg", - "Material__c": "Aluminum" - } - ] -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/__tests__/data/getProductsNoRecords.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/__tests__/data/getProductsNoRecords.json deleted file mode 100644 index 0f54fdab7..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/__tests__/data/getProductsNoRecords.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "pageNumber": 1, - "pageSize": 9, - "totalItemCount": 0, - "records": [] -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/__tests__/productTileList.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/__tests__/productTileList.test.js deleted file mode 100644 index c34485e4b..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/__tests__/productTileList.test.js +++ /dev/null @@ -1,293 +0,0 @@ -import { createElement } from 'lwc'; -import ProductTileList from 'c/productTileList'; -import { - registerTestWireAdapter, - registerApexTestWireAdapter -} from '@salesforce/sfdx-lwc-jest'; -import { publish, MessageContext } from 'lightning/messageService'; -import PRODUCTS_FILTERED_MESSAGE from '@salesforce/messageChannel/ProductsFiltered__c'; -import PRODUCT_SELECTED_MESSAGE from '@salesforce/messageChannel/ProductSelected__c'; -import getProducts from '@salesforce/apex/ProductController.getProducts'; - -// Realistic data with multiple records -const mockGetProducts = require('./data/getProducts.json'); -// An empty list of records to verify the component does something reasonable -// when there is no data to display -const mockGetProductsNoRecords = require('./data/getProductsNoRecords.json'); - -// Register the Apex wire adapter. Some tests verify that provisioned values trigger desired behavior. -const getProductsAdapter = registerApexTestWireAdapter(getProducts); - -// Register as a standard wire adapter because the component under test requires this adapter. -// We don't exercise this wire adapter in the tests. -registerTestWireAdapter(MessageContext); - -describe('c-product-tile-list', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - }); - - describe('getProduct @wire emits records', () => { - it('renders paginator with correct item counts', () => { - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - document.body.appendChild(element); - getProductsAdapter.emit(mockGetProducts); - - // Return a promise to wait for any asynchronous DOM updates. - return Promise.resolve().then(() => { - const paginator = - element.shadowRoot.querySelector('c-paginator'); - expect(paginator).not.toBeNull(); - - // paginator text will look something like: "12 items • page 1 of 2" - const totalPages = Math.ceil( - mockGetProducts.totalItemCount / mockGetProducts.pageSize - ); - const regex = new RegExp( - `${mockGetProducts.totalItemCount} items(.*)page ${mockGetProducts.pageNumber} of ${totalPages}` - ); - expect(paginator.shadowRoot.textContent).toMatch(regex); - }); - }); - - it('increments/decrements page number when "next" and "previous" events fired', () => { - const totalPages = Math.ceil( - mockGetProducts.totalItemCount / mockGetProducts.pageSize - ); - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - document.body.appendChild(element); - getProductsAdapter.emit(mockGetProducts); - - return Promise.resolve() - .then(() => { - const paginator = - element.shadowRoot.querySelector('c-paginator'); - paginator.dispatchEvent(new CustomEvent('next')); - }) - .then(() => { - // DOM is updated after event is fired so need to wait - // another microtask for the rerender - const paginator = - element.shadowRoot.querySelector('c-paginator'); - const currentPage = - parseInt(mockGetProducts.pageNumber, 10) + 1; - const regex = new RegExp( - `page ${currentPage} of ${totalPages}$` - ); - expect(paginator.shadowRoot.textContent).toMatch(regex); - - paginator.dispatchEvent(new CustomEvent('previous')); - }) - .then(() => { - const paginator = - element.shadowRoot.querySelector('c-paginator'); - // we're back to the original page number now - const regex = new RegExp( - `page ${mockGetProducts.pageNumber} of ${totalPages}$` - ); - expect(paginator.shadowRoot.textContent).toMatch(regex); - }); - }); - - it('updates getProducts @wire with new pageNumber', () => { - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - document.body.appendChild(element); - getProductsAdapter.emit(mockGetProducts); - - // Return a promise to wait for any asynchronous DOM updates. - return Promise.resolve() - .then(() => { - const paginator = - element.shadowRoot.querySelector('c-paginator'); - paginator.dispatchEvent(new CustomEvent('next')); - }) - .then(() => { - const { pageNumber } = getProductsAdapter.getLastConfig(); - // we've fired a single 'next' event so increment the original pageNumber - expect(pageNumber).toBe(mockGetProducts.pageNumber + 1); - }); - }); - - it('displays one c-product-tile per record', () => { - const recordCount = mockGetProducts.records.length; - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - document.body.appendChild(element); - getProductsAdapter.emit(mockGetProducts); - - return Promise.resolve().then(() => { - const productTiles = - element.shadowRoot.querySelectorAll('c-product-tile'); - expect(productTiles).toHaveLength(recordCount); - }); - }); - - it('sends productSelected event when c-product-tile selected', () => { - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - document.body.appendChild(element); - getProductsAdapter.emit(mockGetProducts); - - return Promise.resolve().then(() => { - const productTile = - element.shadowRoot.querySelector('c-product-tile'); - productTile.dispatchEvent(new CustomEvent('selected')); - expect(publish).toHaveBeenCalledWith( - undefined, - PRODUCT_SELECTED_MESSAGE, - { productId: null } - ); - }); - }); - }); - - describe('getProduct @wire emits empty list of records', () => { - it('does not render paginator', () => { - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - document.body.appendChild(element); - getProductsAdapter.emit(mockGetProductsNoRecords); - - return Promise.resolve().then(() => { - const paginator = - element.shadowRoot.querySelector('c-paginator'); - expect(paginator).toBeNull(); - }); - }); - - it('renders placeholder with no products message', () => { - const expected = - 'There are no products matching your current selection'; - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - document.body.appendChild(element); - getProductsAdapter.emit(mockGetProductsNoRecords); - - return Promise.resolve().then(() => { - const placeholder = - element.shadowRoot.querySelector('c-placeholder'); - expect(placeholder.shadowRoot.textContent).toBe(expected); - }); - }); - }); - - describe('getProducts @wire error', () => { - it('shows error message element with error details populated', () => { - // This is the default error message that gets emitted from apex - // adapters. See @salesforce/wire-service-jest-util for the source. - const defaultError = 'An internal server error has occurred'; - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - document.body.appendChild(element); - getProductsAdapter.error(); - return Promise.resolve() - .then(() => { - const errorPanel = - element.shadowRoot.querySelector('c-error-panel'); - // Click the "Show Details" link to render additional error messages - const lightningInput = - errorPanel.shadowRoot.querySelector('a'); - lightningInput.dispatchEvent(new CustomEvent('click')); - }) - .then(() => { - const errorPanel = - element.shadowRoot.querySelector('c-error-panel'); - const text = errorPanel.shadowRoot.textContent; - expect(text).toContain(defaultError); - }); - }); - }); - - describe('with search bar visible', () => { - it('updates getProducts @wire with searchKey as filter when search bar changes', () => { - const input = 'foo'; - const expected = { searchKey: input }; - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - element.searchBarIsVisible = true; - document.body.appendChild(element); - getProductsAdapter.emit(mockGetProducts); - - return Promise.resolve() - .then(() => { - const searchBar = - element.shadowRoot.querySelector('.search-bar'); - searchBar.value = input; - searchBar.dispatchEvent(new CustomEvent('change')); - }) - .then(() => { - const { filters } = getProductsAdapter.getLastConfig(); - expect(filters).toEqual(expected); - }); - }); - }); - - describe('with filter changes', () => { - it('updates product list when filters change', () => { - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - document.body.appendChild(element); - - // Simulate filter change - const mockMessage = { - filters: { searchKey: 'mockValue', maxPrice: 666 } - }; - publish(null, PRODUCTS_FILTERED_MESSAGE, mockMessage); - - // Check that wire gets called with new filters - return Promise.resolve().then(() => { - const { filters } = getProductsAdapter.getLastConfig(); - expect(filters).toEqual(mockMessage.filters); - }); - }); - }); - - it('is accessible when products returned', () => { - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - - document.body.appendChild(element); - getProductsAdapter.emit(mockGetProducts); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); - - it('is accessible when no products returned', () => { - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - - document.body.appendChild(element); - getProductsAdapter.emit(mockGetProductsNoRecords); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); - - it('is accessible when error returned', () => { - const element = createElement('c-product-tile-list', { - is: ProductTileList - }); - - document.body.appendChild(element); - getProductsAdapter.error(); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.css deleted file mode 100644 index 976270e2d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.css +++ /dev/null @@ -1,22 +0,0 @@ -.slds-card { - background: rgb(243, 242, 242); -} - -.search-bar { - display: block; - margin: 0 0.5rem 0.3rem 0.5rem; -} - -.content { - display: flex; - flex-wrap: wrap; -} - -c-product-tile { - min-width: 200px; - flex: 1; -} - -c-paginator { - display: block; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.html deleted file mode 100644 index 8f080c282..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.html +++ /dev/null @@ -1,46 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.js deleted file mode 100644 index e6c031310..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.js +++ /dev/null @@ -1,86 +0,0 @@ -import { LightningElement, api, wire } from 'lwc'; - -// Lightning Message Service and message channels -import { publish, subscribe, MessageContext } from 'lightning/messageService'; -import PRODUCTS_FILTERED_MESSAGE from '@salesforce/messageChannel/ProductsFiltered__c'; -import PRODUCT_SELECTED_MESSAGE from '@salesforce/messageChannel/ProductSelected__c'; - -// getProducts() method in ProductController Apex class -import getProducts from '@salesforce/apex/ProductController.getProducts'; - -/** - * Container component that loads and displays a list of Product__c records. - */ -export default class ProductTileList extends LightningElement { - /** - * Whether to display the search bar. - * TODO - normalize value because it may come as a boolean, string or otherwise. - */ - @api searchBarIsVisible = false; - - /** - * Whether the product tiles are draggable. - * TODO - normalize value because it may come as a boolean, string or otherwise. - */ - @api tilesAreDraggable = false; - - /** Current page in the product list. */ - pageNumber = 1; - - /** The number of items on a page. */ - pageSize; - - /** The total number of items matching the selection. */ - totalItemCount = 0; - - /** JSON.stringified version of filters to pass to apex */ - filters = {}; - - /** Load context for Lightning Messaging Service */ - @wire(MessageContext) messageContext; - - /** Subscription for ProductsFiltered Lightning message */ - productFilterSubscription; - - /** - * Load the list of available products. - */ - @wire(getProducts, { filters: '$filters', pageNumber: '$pageNumber' }) - products; - - connectedCallback() { - // Subscribe to ProductsFiltered message - this.productFilterSubscription = subscribe( - this.messageContext, - PRODUCTS_FILTERED_MESSAGE, - (message) => this.handleFilterChange(message) - ); - } - - handleProductSelected(event) { - // Published ProductSelected message - publish(this.messageContext, PRODUCT_SELECTED_MESSAGE, { - productId: event.detail - }); - } - - handleSearchKeyChange(event) { - this.filters = { - searchKey: event.target.value.toLowerCase() - }; - this.pageNumber = 1; - } - - handleFilterChange(message) { - this.filters = { ...message.filters }; - this.pageNumber = 1; - } - - handlePreviousPage() { - this.pageNumber = this.pageNumber - 1; - } - - handleNextPage() { - this.pageNumber = this.pageNumber + 1; - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.js-meta.xml deleted file mode 100644 index 26942b0ef..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/productTileList/productTileList.js-meta.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - 52.0 - true - Product Tile List - - lightning__AppPage - lightning__RecordPage - lightning__HomePage - lightningCommunity__Page - lightningCommunity__Default - - - - - - - Order__c - - - - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/data/getRecord.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/data/getRecord.json deleted file mode 100644 index 3b720f883..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/data/getRecord.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "apiName": "Product__c", - "childRelationships": {}, - "eTag": "846fdcd21a53214d447e578adbe263c6", - "fields": { - "Product_Family__c": { - "displayValue": null, - "value": "amy@demo.net" - } - }, - "id": "0031700000pHcf8AAC" -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/data/similarProducts.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/data/similarProducts.json deleted file mode 100644 index 39c29e685..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/data/similarProducts.json +++ /dev/null @@ -1,35 +0,0 @@ -[ - { - "Id": "a033B00000381hVQAQ", - "Name": "VOLT X1", - "MSRP__c": 1200, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Commuter", - "Level__c": "Beginner", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/voltx1.jpg", - "Material__c": "Aluminum", - "$serId$": 1602 - }, - { - "Id": "a033B00000381hWQAQ", - "Name": "VOLT X2", - "MSRP__c": 1400, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Commuter", - "Level__c": "Beginner", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/voltx2.jpg", - "Material__c": "Aluminum", - "$serId$": 1603 - }, - { - "Id": "a033B00000381hXQAQ", - "Name": "VOLT X3", - "MSRP__c": 1800, - "Description__c": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "Category__c": "Commuter", - "Level__c": "Beginner", - "Picture_URL__c": "https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/voltx3.jpg", - "Material__c": "Aluminum", - "$serId$": 1604 - } -] diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/data/similarProductsWithoutData.json b/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/data/similarProductsWithoutData.json deleted file mode 100644 index fe51488c7..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/data/similarProductsWithoutData.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/similarProducts.test.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/similarProducts.test.js deleted file mode 100644 index bc6e1ebfd..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/__tests__/similarProducts.test.js +++ /dev/null @@ -1,190 +0,0 @@ -import { createElement } from 'lwc'; -import SimilarProducts from 'c/similarProducts'; -import { - registerLdsTestWireAdapter, - registerApexTestWireAdapter -} from '@salesforce/sfdx-lwc-jest'; -import { getRecord } from 'lightning/uiRecordApi'; -import getSimilarProducts from '@salesforce/apex/ProductController.getSimilarProducts'; - -// Mock realistic data for the getRecord adapter -const mockGetRecord = require('./data/getRecord.json'); - -// Mock realistic data for the getSimilarProducts adapter -const mockSimilarProducts = require('./data/similarProducts.json'); - -// Mock empty data for the getSimilarProducts adapter -const mockSimilarProductsWithoutData = require('./data/similarProductsWithoutData.json'); - -// Mock realistic data for the public properties -const mockRecordId = '0031700000pHcf8AAC'; -const mockFamilyId = '0069500000pGbk8DDC'; -const mockWireErrorMessage = 'Error retrieving records'; - -//Expected Wire Input -const WIRE_INPUT = { - fields: [ - { - fieldApiName: 'Product_Family__c', - objectApiName: 'Product__c' - } - ], - recordId: '0031700000pHcf8AAC' -}; - -// Register as an LDS wire adapter. Some tests verify the provisioned values trigger desired behavior. -const getRecordAdapter = registerLdsTestWireAdapter(getRecord); - -// Register as Apex wire adapter. Some tests verify that provisioned values trigger desired behavior. -const getSimilarProductsListAdapter = - registerApexTestWireAdapter(getSimilarProducts); - -describe('c-similar-products', () => { - afterEach(() => { - // The jsdom instance is shared across test cases in a single file so reset the DOM - while (document.body.firstChild) { - document.body.removeChild(document.body.firstChild); - } - }); - - it('displays a list of product tiles when the Apex wire adapter returns data', () => { - const element = createElement('c-similar-products', { - is: SimilarProducts - }); - element.recordId = mockRecordId; - element.familyId = mockFamilyId; - document.body.appendChild(element); - - // Emit data from getRecord adapter - getRecordAdapter.emit(mockGetRecord); - - // Emit Data from the Apex wire adapter. - getSimilarProductsListAdapter.emit(mockSimilarProducts); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Check the wire parameters are correct - expect(getRecordAdapter.getLastConfig()).toEqual(WIRE_INPUT); - // Select elements for validation - const productListItemEl = element.shadowRoot.querySelectorAll( - 'c-product-list-item' - ); - expect(productListItemEl.length).toBe(mockSimilarProducts.length); - expect(productListItemEl[0].product).toStrictEqual( - mockSimilarProducts[0] - ); - }); - }); - - it('displays a placeholder when no similar products are returned', () => { - const element = createElement('c-similar-products', { - is: SimilarProducts - }); - element.recordId = mockRecordId; - element.familyId = mockFamilyId; - document.body.appendChild(element); - - // Emit data from getRecord adapter - getRecordAdapter.emit(mockGetRecord); - - // Emit an empty array from the Apex wire adapter. - getSimilarProductsListAdapter.emit(mockSimilarProductsWithoutData); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - return Promise.resolve().then(() => { - // Check the wire parameters are correct - expect(getRecordAdapter.getLastConfig()).toEqual(WIRE_INPUT); - // Select elements for validation - const placeholderEl = - element.shadowRoot.querySelector('c-placeholder'); - expect(placeholderEl).not.toBeNull(); - }); - }); - - it('displays an error panel when the Apex wire adapter returns an error', () => { - const element = createElement('c-similar-products', { - is: SimilarProducts - }); - element.recordId = mockRecordId; - element.familyId = mockFamilyId; - document.body.appendChild(element); - - // Emit data from getRecord adapter - getRecordAdapter.emit(mockGetRecord); - - // Emit an error from the Apex wire adapter. - getSimilarProductsListAdapter.error(mockWireErrorMessage); - - // Return a promise to wait for any asynchronous DOM updates. Jest - // will automatically wait for the Promise chain to complete before - // ending the test and fail the test if the promise rejects. - - return Promise.resolve().then(() => { - // Check the wire parameters are correct - expect(getRecordAdapter.getLastConfig()).toEqual(WIRE_INPUT); - // Select elements for validation - const errorPanelEl = - element.shadowRoot.querySelector('c-error-panel'); - expect(errorPanelEl).not.toBeNull(); - expect(errorPanelEl.errors[0].body).toBe(mockWireErrorMessage); - expect(errorPanelEl.friendlyMessage).toBe( - 'An error has occurred while retrieving similar products' - ); - }); - }); - - it('is accessible when similar products returned', () => { - const element = createElement('c-similar-products', { - is: SimilarProducts - }); - - element.recordId = mockRecordId; - element.familyId = mockFamilyId; - document.body.appendChild(element); - - // Emit data from getRecord adapter - getRecordAdapter.emit(mockGetRecord); - - // Emit Data from the Apex wire adapter. - getSimilarProductsListAdapter.emit(mockSimilarProducts); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); - - it('is accessible when no similar products returned', () => { - const element = createElement('c-similar-products', { - is: SimilarProducts - }); - - element.recordId = mockRecordId; - element.familyId = mockFamilyId; - document.body.appendChild(element); - - // Emit data from getRecord adapter - getRecordAdapter.emit(mockGetRecord); - - // Emit an empty array from the Apex wire adapter. - getSimilarProductsListAdapter.emit(mockSimilarProductsWithoutData); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); - - it('is accessible when error returned', () => { - const element = createElement('c-similar-products', { - is: SimilarProducts - }); - - element.recordId = mockRecordId; - element.familyId = mockFamilyId; - document.body.appendChild(element); - - // Emit an error from the Apex wire adapter. - getSimilarProductsListAdapter.error(mockWireErrorMessage); - - return Promise.resolve().then(() => expect(element).toBeAccessible()); - }); -}); diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.css b/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.css deleted file mode 100644 index 6ffbb8f43..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.css +++ /dev/null @@ -1,5 +0,0 @@ -img.product { - height: 120px; - max-width: initial; - pointer-events: none; -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.html b/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.html deleted file mode 100644 index 5554e7e29..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.html +++ /dev/null @@ -1,25 +0,0 @@ - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.js b/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.js deleted file mode 100644 index 9854ca444..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.js +++ /dev/null @@ -1,30 +0,0 @@ -import { LightningElement, api, wire } from 'lwc'; -import { getRecord } from 'lightning/uiRecordApi'; -import getSimilarProducts from '@salesforce/apex/ProductController.getSimilarProducts'; -import PRODUCT_FAMILY_FIELD from '@salesforce/schema/Product__c.Product_Family__c'; - -const fields = [PRODUCT_FAMILY_FIELD]; - -export default class SimilarProducts extends LightningElement { - @api recordId; - @api familyId; - - // Track changes to the Product_Family__c field that could be made in other components. - // If Product_Family__c is updated in another component, getSimilarProducts - // is automatically re-invoked with the new this.familyId parameter - @wire(getRecord, { recordId: '$recordId', fields }) - product; - - @wire(getSimilarProducts, { - productId: '$recordId', - familyId: '$product.data.fields.Product_Family__c.value' - }) - similarProducts; - - get errors() { - const errors = [this.product.error, this.similarProducts.error].filter( - (error) => error - ); - return errors.length ? errors : undefined; - } -} diff --git a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.js-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.js-meta.xml deleted file mode 100644 index 0b20ea550..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/lwc/similarProducts/similarProducts.js-meta.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - 52.0 - true - Similar Products - - lightning__RecordPage - lightningCommunity__Page - lightningCommunity__Default - - - - - Product__c - - - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/messageChannel/ProductSelected.messageChannel-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/messageChannel/ProductSelected.messageChannel-meta.xml deleted file mode 100644 index 451381031..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/messageChannel/ProductSelected.messageChannel-meta.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - ProductSelected - This event is fired when a product is selected. - - productId - Selected product Id. - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/messageChannel/ProductsFiltered.messageChannel-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/messageChannel/ProductsFiltered.messageChannel-meta.xml deleted file mode 100644 index ea6c0e734..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/messageChannel/ProductsFiltered.messageChannel-meta.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - ProductsFiltered - This event is fired when product filters change. - - filters - Current product filters - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/navigationMenus/Default_Navigation.navigationMenu-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/navigationMenus/Default_Navigation.navigationMenu-meta.xml deleted file mode 100644 index 69cf8e248..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/navigationMenus/Default_Navigation.navigationMenu-meta.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - E-Bikes - Network - - - - 1 - true - /product-explorer - InternalLink - - - All_Product_Families - - 2 - true - Product_Family__c - SalesforceObject - - - - 3 - true - /create-case - InternalLink - - - My_Cases - - 4 - true - Case - SalesforceObject - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/networkBranding/cbE_Bikes.networkBranding b/test/nuts/ebikes-lwc/force-app/main/default/networkBranding/cbE_Bikes.networkBranding deleted file mode 100644 index 9e26dfeeb..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/networkBranding/cbE_Bikes.networkBranding +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/test/nuts/ebikes-lwc/force-app/main/default/networkBranding/cbE_Bikes.networkBranding-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/networkBranding/cbE_Bikes.networkBranding-meta.xml deleted file mode 100644 index f7fdd1e01..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/networkBranding/cbE_Bikes.networkBranding-meta.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - E-Bikes - #1797C0 - #FFFFFF - #B1BAC1 - #222222 - #51606E - #DDE4E9 - #222222 - #51606E - #FFFFFF - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/networks/E-Bikes.network-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/networks/E-Bikes.network-meta.xml deleted file mode 100644 index 879f3a0a2..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/networks/E-Bikes.network-meta.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - false - false - unfiled$public/CommunityChangePasswordEmailTemplate - - A community for electric bikes enthusiasts - true - some.sender@company.com - E-Bikes - false - true - false - true - false - false - false - false - true - false - false - false - true - true - true - false - false - unfiled$public/CommunityForgotPasswordEmailTemplate - false - - Admin - - - Standard - Designer - Designer - Designer - Designer - - E_Bikes1 - false - true - E_Bikes - Live - - home - Chatter - - ebikes - unfiled$public/CommunityWelcomeEmailTemplate - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Account/Account.object-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Account/Account.object-meta.xml deleted file mode 100644 index e68c6d267..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Account/Account.object-meta.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - CallHighlightAction - Default - - - CancelEdit - Default - - - Delete - Default - - - Edit - Default - - - EmailHighlightAction - Default - - - EnableCustomerPortalUser - Default - - - List - Default - - - ListClean - Default - - - New - Default - - - RequestUpdate - Default - - - SaveEdit - Default - - - SmsHighlightAction - Default - - - Tab - Default - - - View - Default - - - ViewCustomerPortalUser - Default - - - WebsiteHighlightAction - Default - - - View - Account_Record_Page - Large - false - Flexipage - - SYSTEM - true - false - - ACCOUNT.NAME - ACCOUNT.ADDRESS1_CITY - ACCOUNT.PHONE1 - ACCOUNT.NAME - ACCOUNT.SITE - CORE.USERS.ALIAS - ACCOUNT.TYPE - ACCOUNT.NAME - ACCOUNT.SITE - CORE.USERS.ALIAS - ACCOUNT.TYPE - ACCOUNT.PHONE1 - ACCOUNT.NAME - ACCOUNT.SITE - ACCOUNT.PHONE1 - CORE.USERS.ALIAS - - ReadWrite - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Account/listViews/All_Acounts.listView-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Account/listViews/All_Acounts.listView-meta.xml deleted file mode 100644 index 07b10e1b2..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Account/listViews/All_Acounts.listView-meta.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - All_Acounts - ACCOUNT.NAME - ACCOUNT.ADDRESS1_STATE - CORE.USERS.ALIAS - Everything - - - CEO - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Case/fields/Case_Category__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Case/fields/Case_Category__c.field-meta.xml deleted file mode 100644 index b8a07c9c8..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Case/fields/Case_Category__c.field-meta.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - Case_Category__c - false - - false - false - false - false - Picklist - - true - - false - - Mechanical - false - - - - Electrical - false - - - - Electronic - false - - - - Structural - false - - - - Other - false - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Case/fields/Product__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Case/fields/Product__c.field-meta.xml deleted file mode 100644 index 1bec4c950..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Case/fields/Product__c.field-meta.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - Product__c - SetNull - false - - Product__c - Products - Cases - false - false - false - false - Lookup - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Case/listViews/My_Cases.listView-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Case/listViews/My_Cases.listView-meta.xml deleted file mode 100644 index a6f108509..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Case/listViews/My_Cases.listView-meta.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - My_Cases - CASES.CASE_NUMBER - CASES.STATUS - Product__c - Mine - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/Order_Item__c.object-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/Order_Item__c.object-meta.xml deleted file mode 100644 index 058cc79b7..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/Order_Item__c.object-meta.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - Accept - Default - - - CancelEdit - Default - - - Clone - Default - - - Delete - Default - - - Edit - Default - - - List - Default - - - New - Default - - - SaveEdit - Default - - - Tab - Default - - - View - Default - - false - SYSTEM - Deployed - false - true - false - false - false - false - true - true - - - OI-{000000} - - AutoNumber - - Order Items - - ControlledByParent - Public - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Order__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Order__c.field-meta.xml deleted file mode 100644 index 728ef9081..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Order__c.field-meta.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - Order__c - false - - Order__c - Order Items - Order_Items - 0 - false - false - MasterDetail - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Price__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Price__c.field-meta.xml deleted file mode 100644 index b4879537a..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Price__c.field-meta.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - Price__c - false - - 6 - false - 0 - false - Currency - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Product__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Product__c.field-meta.xml deleted file mode 100644 index ec28f568f..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Product__c.field-meta.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - Product__c - SetNull - false - - Product__c - Order Items - Order_Items - false - false - Lookup - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Qty_L__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Qty_L__c.field-meta.xml deleted file mode 100644 index 52a16d0bc..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Qty_L__c.field-meta.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - Qty_L__c - 1 - false - - 3 - false - 0 - false - Number - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Qty_M__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Qty_M__c.field-meta.xml deleted file mode 100644 index 245b703a7..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Qty_M__c.field-meta.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - Qty_M__c - 1 - false - - 3 - false - 0 - false - Number - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Qty_S__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Qty_S__c.field-meta.xml deleted file mode 100644 index 94280478d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order_Item__c/fields/Qty_S__c.field-meta.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - Qty_S__c - 1 - false - - 3 - false - 0 - false - Number - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order__c/Order__c.object-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Order__c/Order__c.object-meta.xml deleted file mode 100644 index bdd43ba6e..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order__c/Order__c.object-meta.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - Accept - Default - - - CancelEdit - Default - - - Clone - Default - - - Delete - Default - - - Edit - Default - - - List - Default - - - New - Default - - - SaveEdit - Default - - - Tab - Default - - - View - Order_Record_Page - Large - false - Flexipage - - true - SYSTEM - Deployed - false - true - false - false - true - false - true - true - - - O-{00000} - - AutoNumber - - Reseller Orders - - ReadWrite - Public - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order__c/fields/Account__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Order__c/fields/Account__c.field-meta.xml deleted file mode 100644 index f9db8b8fd..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Order__c/fields/Account__c.field-meta.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - Account__c - Restrict - false - - Account - Orders - true - false - false - Lookup - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/Product_Family__c.object-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/Product_Family__c.object-meta.xml deleted file mode 100644 index 16c6206e9..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/Product_Family__c.object-meta.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - Accept - Default - - - CancelEdit - Default - - - Clone - Default - - - Delete - Default - - - Edit - Default - - - List - Default - - - New - Default - - - SaveEdit - Default - - - Tab - Default - - - View - Default - - false - SYSTEM - Deployed - false - true - false - false - false - false - false - true - true - - - - Text - - Product Families - - ReadWrite - Public - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/fields/Category__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/fields/Category__c.field-meta.xml deleted file mode 100644 index 78e96bd0f..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/fields/Category__c.field-meta.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - Category__c - false - - false - false - Picklist - - true - - false - - Commuter - false - - - - Hybrid - false - - - - Mountain - false - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/fields/Description__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/fields/Description__c.field-meta.xml deleted file mode 100644 index 68587573a..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/fields/Description__c.field-meta.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - Description__c - false - - false - false - TextArea - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/listViews/All_Product_Families.listView-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/listViews/All_Product_Families.listView-meta.xml deleted file mode 100644 index 72a0c1b61..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product_Family__c/listViews/All_Product_Families.listView-meta.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - All_Product_Families - NAME - Everything - - - CEO - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/Product__c.object-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/Product__c.object-meta.xml deleted file mode 100644 index c968412da..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/Product__c.object-meta.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - Accept - Default - - - CancelEdit - Default - - - Clone - Default - - - Delete - Default - - - Edit - Default - - - List - Default - - - New - Default - - - SaveEdit - Default - - - Tab - Default - - - View - Action override created by Lightning App Builder during activation. - Product_Record_Page - Large - false - Flexipage - - true - SYSTEM - Deployed - false - true - false - false - true - false - true - true - - - - Text - - Products - - ReadWrite - Public - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Battery__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Battery__c.field-meta.xml deleted file mode 100644 index 244e93637..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Battery__c.field-meta.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - Battery__c - false - - 100 - false - false - Text - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Category__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Category__c.field-meta.xml deleted file mode 100644 index 3a532a795..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Category__c.field-meta.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - Category__c - false - - false - false - Picklist - - true - - false - - Mountain - false - - - - Commuter - false - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Charger__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Charger__c.field-meta.xml deleted file mode 100644 index b1f2ac711..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Charger__c.field-meta.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - Charger__c - false - - 100 - false - false - Text - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Description__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Description__c.field-meta.xml deleted file mode 100644 index 86013967f..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Description__c.field-meta.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - Description__c - false - - 1000 - false - LongTextArea - 5 - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Fork__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Fork__c.field-meta.xml deleted file mode 100644 index 651cfa009..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Fork__c.field-meta.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - Fork__c - false - - 100 - false - false - Text - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Frame_Color__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Frame_Color__c.field-meta.xml deleted file mode 100644 index a07935e37..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Frame_Color__c.field-meta.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - Frame_Color__c - false - - false - false - Picklist - - true - - false - - white - false - - - - red - false - - - - blue - false - - - - green - false - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Front_Brakes__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Front_Brakes__c.field-meta.xml deleted file mode 100644 index 7f5f609ae..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Front_Brakes__c.field-meta.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - Front_Brakes__c - false - - 100 - false - false - Text - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Handlebar_Color__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Handlebar_Color__c.field-meta.xml deleted file mode 100644 index 98c6addb8..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Handlebar_Color__c.field-meta.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - Handlebar_Color__c - false - - false - false - Picklist - - true - - false - - white - false - - - - red - false - - - - blue - false - - - - green - false - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Level__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Level__c.field-meta.xml deleted file mode 100644 index e13f50a9d..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Level__c.field-meta.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - Level__c - false - - false - false - Picklist - - true - - false - - Beginner - false - - - - Enthusiast - false - - - - Racer - false - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/MSRP__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/MSRP__c.field-meta.xml deleted file mode 100644 index 0f7e5737b..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/MSRP__c.field-meta.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - MSRP__c - false - - 6 - false - 0 - false - Currency - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Material__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Material__c.field-meta.xml deleted file mode 100644 index 27f9ccaba..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Material__c.field-meta.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - Material__c - false - - false - false - Picklist - - true - - false - - Aluminum - false - - - - Carbon - false - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Motor__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Motor__c.field-meta.xml deleted file mode 100644 index d0c536c7a..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Motor__c.field-meta.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - Motor__c - false - - 100 - false - false - Text - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Picture_URL__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Picture_URL__c.field-meta.xml deleted file mode 100644 index 373b0bb69..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Picture_URL__c.field-meta.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - Picture_URL__c - false - - false - false - Url - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Product_Family__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Product_Family__c.field-meta.xml deleted file mode 100644 index d2ddb2584..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Product_Family__c.field-meta.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - Product_Family__c - SetNull - false - - Product_Family__c - Products - Products - false - false - Lookup - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Rear_Brakes__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Rear_Brakes__c.field-meta.xml deleted file mode 100644 index eaedb0b89..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Rear_Brakes__c.field-meta.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - Rear_Brakes__c - false - - 100 - false - false - Text - false - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Seat_Color__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Seat_Color__c.field-meta.xml deleted file mode 100644 index 9f1ba5404..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Seat_Color__c.field-meta.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - Seat_Color__c - false - - false - false - Picklist - - true - - false - - white - false - - - - red - false - - - - blue - false - - - - green - false - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Waterbottle_Color__c.field-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Waterbottle_Color__c.field-meta.xml deleted file mode 100644 index 7dc77e6ad..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/fields/Waterbottle_Color__c.field-meta.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - Waterbottle_Color__c - false - - false - false - Picklist - - true - - false - - white - false - - - - red - false - - - - blue - false - - - - green - false - - - - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/listViews/ProductList.listView-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/listViews/ProductList.listView-meta.xml deleted file mode 100644 index a4880df43..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/objects/Product__c/listViews/ProductList.listView-meta.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - ProductList - OBJECT_ID - NAME - MSRP__c - Description__c - Category__c - Level__c - Picture_URL__c - Material__c - Everything - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/pages/CommunitiesLanding.page b/test/nuts/ebikes-lwc/force-app/main/default/pages/CommunitiesLanding.page deleted file mode 100644 index 6bf75d5b8..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/pages/CommunitiesLanding.page +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/pages/CommunitiesLanding.page-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/pages/CommunitiesLanding.page-meta.xml deleted file mode 100644 index 5a4c21e31..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/pages/CommunitiesLanding.page-meta.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - 52.0 - false - false - Default communities landing page - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/permissionsets/ebikes.permissionset-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/permissionsets/ebikes.permissionset-meta.xml deleted file mode 100644 index f07b0bcb8..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/permissionsets/ebikes.permissionset-meta.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - - EBikes - true - - - true - Case.AccountId - true - - - true - Case.Description - true - - - true - Order_Item__c.Price__c - true - - - true - Order_Item__c.Product__c - true - - - true - Order_Item__c.Qty_L__c - true - - - true - Order_Item__c.Qty_M__c - true - - - true - Order_Item__c.Qty_S__c - true - - - true - Product_Family__c.Category__c - true - - - true - Product_Family__c.Description__c - true - - - true - Product__c.Battery__c - true - - - true - Product__c.Category__c - true - - - true - Product__c.Charger__c - true - - - true - Product__c.Description__c - true - - - true - Product__c.Fork__c - true - - - true - Product__c.Front_Brakes__c - true - - - true - Product__c.Level__c - true - - - true - Product__c.MSRP__c - true - - - true - Product__c.Material__c - true - - - true - Product__c.Motor__c - true - - - true - Product__c.Picture_URL__c - true - - - true - Product__c.Product_Family__c - true - - - true - Product__c.Rear_Brakes__c - true - - - true - Product__c.Frame_Color__c - true - - - true - Product__c.Seat_Color__c - true - - - true - Product__c.Handlebar_Color__c - true - - - true - Product__c.Waterbottle_Color__c - true - - false - - - false - false - false - true - false - Account - true - - - true - true - true - true - false - Case - true - - - false - false - false - true - false - Order - true - - - true - true - true - true - true - Order_Item__c - true - - - true - true - true - true - true - Order__c - true - - - true - true - true - true - true - Product_Family__c - true - - - true - true - true - true - true - Product__c - true - - - Order__c - Visible - - - Product_Explorer - Visible - - - Product_Family__c - Visible - - - Product__c - Visible - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/prompts/OrderBuilder.prompt-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/prompts/OrderBuilder.prompt-meta.xml deleted file mode 100644 index bbe5f9d83..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/prompts/OrderBuilder.prompt-meta.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - Order Builder - - The order builder allows you to drag products into the basket and construct an order for the customer. - 1 - Use the Order Builder to learn more about component composition. - Close - TopCenter - FloatingPanel - true - Order Builder Step 1 - 2020-10-15 - false - true - 2020-10-09 - 1 - EBikes - Order__c - view - standard__recordPage - 1 - Welcome to the Order Builder - Everyone - Everyone - 1 - - - Here you can see a list of available products to add to each order as well as search for products that might not be in the list. <br> <br> Try searching for an "Electra X1" and see the results as they're updated. - Close - BottomRight - FloatingPanel - false - Order Builder Step 2 - false - false - 2 - EBikes - Order__c - view - standard__recordPage - Product List - Everyone - Everyone - 1 - - - You can drag products from the list into the basket. As you add products, the totals will update and relate the records to the order. - Close - TopCenter - FloatingPanel - false - Order Builder Step 3 - false - false - 3 - EBikes - Order__c - view - standard__recordPage - Order - Everyone - Everyone - 1 - - - You can now modify the price & quantity of the product being ordered. Once modified the totals on the order will be updated.<br><br>This is done using <a href="https://sfdc.co/B8HXD">Custom Events</a> sent up from the Order Item Component. - Close - TopCenter - FloatingPanel - false - Order Builder Step 4 - false - false - 4 - EBikes - Order__c - view - standard__recordPage - Order Details - Everyone - Everyone - 1 - - - <p>Now that you have seen Lightning Web Components used to create an interactive ordering experience, you can learn how to build them yourself!</p><p><br></p><p>As demonstrated, you can follow web standards like using Custom Events &amp; The Drag &amp; Drop API to communicate across components.</p><p><br></p><p>Make sure you check out the <b>Product Explorer </b>Tab for more great ways you can innovate with Lightning Web Components.</p> - BottomCenter - DockedComposer -
Resources
- false - Order Builder Step 5 - false - false - 5 - EBikes - Order__c - view - standard__recordPage - Resources - Everyone - Everyone - 1 -
-
diff --git a/test/nuts/ebikes-lwc/force-app/main/default/prompts/ProductDetail.prompt-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/prompts/ProductDetail.prompt-meta.xml deleted file mode 100644 index c751aeb92..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/prompts/ProductDetail.prompt-meta.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - Product Detail - - The product detail page shows you all of the details related to a product as well as similar products. - 1 - Explore the product detail page and it's functionality. - Close - TopCenter - FloatingPanel - true - Product Detail Step 1 - 2020-10-09 - false - false - 2020-10-09 - 1 - EBikes - Product__c - view - standard__recordPage - 1 - Product Details - Everyone - Everyone - 1 - - - The similar product component displays a list of similar products. <br><br> You can select <b>View Details</b> and navigate to the products detail page. This is done using <a href="https://sfdc.co/bOaUVi">Lightning Navigation Service</a>. - Close - BottomRight - FloatingPanel - false - Product Detail Step 2 - false - false - 2 - EBikes - Product__c - view - standard__recordPage - Similar Products - Everyone - Everyone - 1 - - - <p>Here you can see how just a single Lightning Web Component can enhance the user experience in the context of a record. </p><p><br></p><p>Check out the Order Builder in the <b>Reseller Orders</b> Tab to learn more about composing multiple components on a record detail page. </p><p><br></p> - BottomCenter - DockedComposer -
Resources
- false - Product Detail Step 3 - false - false - 3 - EBikes - Product__c - view - standard__recordPage - Resources - Everyone - Everyone - 1 -
-
diff --git a/test/nuts/ebikes-lwc/force-app/main/default/prompts/ProductExplorer.prompt-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/prompts/ProductExplorer.prompt-meta.xml deleted file mode 100644 index cb69ad540..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/prompts/ProductExplorer.prompt-meta.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - Product Explorer - - The Product Explorer lets you browse thought E-Bikes products. - 1 - Close - TopCenter - FloatingPanel - true - Product Explorer Step 1 - 2020-10-09 - false - false - 2020-08-06 - 1 - EBikes - Product_Explorer - standard__navItemPage - 1 - Welcome to E-Bikes Product Explorer - Everyone - Everyone - 1 - - - Filters control the list of displayed products with the <a href="https://developer.salesforce.com/docs/component-library/bundle/lightning-message-service">Lightning Message Service</a> (LMS). - Close - BottomLeft - FloatingPanel - false - Product Explorer Step 2 - false - false - 2 - EBikes - Product_Explorer - standard__navItemPage - Filters - Everyone - Everyone - 1 - - - E-Bikes products are shown in this paginated list.<br/>Click on one of the tiles to view product details. - Close - BottomCenter - FloatingPanel - false - Product Explorer Step 3 - false - false - 3 - EBikes - Product_Explorer - standard__navItemPage - Product Tile List - Everyone - Everyone - 1 - - - GitHub - https://github.com/trailheadapps/ebikes-lwc - Selected product's details are shown in this section.<br/>Click on the top right double arrow icon to navigate to the product record page. - Close - BottomRight - FloatingPanel - false - Product Explorer Step 4 - true - false - 4 - EBikes - Product_Explorer - standard__navItemPage - Product Details - Everyone - Everyone - 1 - - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/sites/E_Bikes.site-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/sites/E_Bikes.site-meta.xml deleted file mode 100644 index 68aa65cb0..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/sites/E_Bikes.site-meta.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - true - false - false - false - false - true - false - CommunitiesLogin - BandwidthExceeded - true - SameOriginOnly - true - true - FileNotFound - Exception - InMaintenance - CommunitiesLanding - E-Bikes - true - CommunitiesSelfReg - test-yypfaowt42yo@example.com - test-yypfaowt42yo@example.com - ChatterNetwork - efficiency-connect-1801-dev--1701a0bb7eb - ebikes - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets.resource-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets.resource-meta.xml deleted file mode 100644 index c7fdae621..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets.resource-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - Public - application/zip - \ No newline at end of file diff --git a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/CyclingGrass.jpg b/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/CyclingGrass.jpg deleted file mode 100644 index 2d5586d6c..000000000 Binary files a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/CyclingGrass.jpg and /dev/null differ diff --git a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/commuter.png b/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/commuter.png deleted file mode 100644 index ed5ecebed..000000000 Binary files a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/commuter.png and /dev/null differ diff --git a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/enthusiast.png b/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/enthusiast.png deleted file mode 100644 index 1510332de..000000000 Binary files a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/enthusiast.png and /dev/null differ diff --git a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/logo.svg b/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/logo.svg deleted file mode 100644 index 70e455beb..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/logo.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - Slice - Created with Sketch. - - - - - - - - - - - - \ No newline at end of file diff --git a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/racer.png b/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/racer.png deleted file mode 100644 index eab81d1f3..000000000 Binary files a/test/nuts/ebikes-lwc/force-app/main/default/staticresources/bike_assets/racer.png and /dev/null differ diff --git a/test/nuts/ebikes-lwc/force-app/main/default/tabs/Order__c.tab-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/tabs/Order__c.tab-meta.xml deleted file mode 100644 index 3f9a6b0ac..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/tabs/Order__c.tab-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - true - Custom13: Box - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/tabs/Product_Explorer.tab-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/tabs/Product_Explorer.tab-meta.xml deleted file mode 100644 index e8104b8cc..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/tabs/Product_Explorer.tab-meta.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - Created by Lightning App Builder - Product_Explorer - - Custom3: Sun - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/tabs/Product_Family__c.tab-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/tabs/Product_Family__c.tab-meta.xml deleted file mode 100644 index 35d9914eb..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/tabs/Product_Family__c.tab-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - true - Custom18: Form - diff --git a/test/nuts/ebikes-lwc/force-app/main/default/tabs/Product__c.tab-meta.xml b/test/nuts/ebikes-lwc/force-app/main/default/tabs/Product__c.tab-meta.xml deleted file mode 100644 index 92848eebe..000000000 --- a/test/nuts/ebikes-lwc/force-app/main/default/tabs/Product__c.tab-meta.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - true - Custom57: Building Block - diff --git a/test/nuts/ebikes-lwc/force-app/test/jest-mocks/apex.js b/test/nuts/ebikes-lwc/force-app/test/jest-mocks/apex.js deleted file mode 100644 index ed4a63972..000000000 --- a/test/nuts/ebikes-lwc/force-app/test/jest-mocks/apex.js +++ /dev/null @@ -1,4 +0,0 @@ -// Mocking how getSObjectValue retrieves the field value. -export const getSObjectValue = (object, field) => { - return object[field.fieldApiName]; -}; diff --git a/test/nuts/ebikes-lwc/force-app/test/jest-mocks/lightning/messageService.js b/test/nuts/ebikes-lwc/force-app/test/jest-mocks/lightning/messageService.js deleted file mode 100644 index 4ee1cef96..000000000 --- a/test/nuts/ebikes-lwc/force-app/test/jest-mocks/lightning/messageService.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * For the original lightning/messageService (LMS) stub that comes by default with - * @salesforce/sfdx-lwc-jest, see: - * https://github.com/salesforce/sfdx-lwc-jest/blob/main/src/lightning-stubs/messageService/messageService.js - */ - -export const APPLICATION_SCOPE = Symbol('APPLICATION_SCOPE'); -export const createMessageChannel = jest.fn(); -export const createMessageContext = jest.fn(); -export const MessageContext = jest.fn(); -export const releaseMessageContext = jest.fn(); -export const unsubscribe = jest.fn(); - -// LMS stub implementation that lets you test a single message handler on a single channel -var _messageChannel = null; -var _messageHandler = null; - -export const publish = jest.fn((messageContext, messageChannel, message) => { - if (_messageHandler && _messageChannel === messageChannel) { - _messageHandler(message); - } -}); - -export const subscribe = jest.fn( - (messageContext, messageChannel, messageHandler) => { - _messageChannel = messageChannel; - _messageHandler = messageHandler; - } -); diff --git a/test/nuts/ebikes-lwc/force-app/test/jest-mocks/lightning/navigation.js b/test/nuts/ebikes-lwc/force-app/test/jest-mocks/lightning/navigation.js deleted file mode 100644 index 00fcdb011..000000000 --- a/test/nuts/ebikes-lwc/force-app/test/jest-mocks/lightning/navigation.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * For the original lightning/navigation mock that comes by default with - * @salesforce/sfdx-lwc-jest, see: - * https://github.com/salesforce/sfdx-lwc-jest/blob/main/src/lightning-mocks/navigation/navigation.js - */ -export const CurrentPageReference = jest.fn(); - -let _pageReference, _replace; - -const Navigate = Symbol('Navigate'); -const GenerateUrl = Symbol('GenerateUrl'); -export const NavigationMixin = (Base) => { - return class extends Base { - [Navigate](pageReference, replace) { - _pageReference = pageReference; - _replace = replace; - } - [GenerateUrl](pageReference) {} - }; -}; -NavigationMixin.Navigate = Navigate; -NavigationMixin.GenerateUrl = GenerateUrl; - -/* - * Tests do not have access to the internals of this mixin used by the - * component under test so save a reference to the arguments the Navigate method is - * invoked with and provide access with this function. - */ -export const getNavigateCalledWith = () => { - return { - pageReference: _pageReference, - replace: _replace - }; -}; diff --git a/test/nuts/ebikes-lwc/jest-sa11y-setup.js b/test/nuts/ebikes-lwc/jest-sa11y-setup.js deleted file mode 100644 index 97b170e7f..000000000 --- a/test/nuts/ebikes-lwc/jest-sa11y-setup.js +++ /dev/null @@ -1,3 +0,0 @@ -import { registerSa11yMatcher } from '@sa11y/jest'; - -registerSa11yMatcher(); diff --git a/test/nuts/ebikes-lwc/jest.config.js b/test/nuts/ebikes-lwc/jest.config.js deleted file mode 100644 index 1a4c695fc..000000000 --- a/test/nuts/ebikes-lwc/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -const { jestConfig } = require('@salesforce/sfdx-lwc-jest/config'); -const setupFilesAfterEnv = jestConfig.setupFilesAfterEnv || []; -setupFilesAfterEnv.push('/jest-sa11y-setup.js'); -module.exports = { - ...jestConfig, - moduleNameMapper: { - '^@salesforce/apex$': '/force-app/test/jest-mocks/apex', - '^lightning/navigation$': - '/force-app/test/jest-mocks/lightning/navigation', - '^lightning/messageService$': - '/force-app/test/jest-mocks/lightning/messageService' - }, - setupFilesAfterEnv -}; diff --git a/test/nuts/ebikes-lwc/package.json b/test/nuts/ebikes-lwc/package.json deleted file mode 100644 index 5a01efa1e..000000000 --- a/test/nuts/ebikes-lwc/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "ebikes-lwc", - "private": true, - "version": "1.0.0", - "description": "EBikes Sample App - Lightning Web Components", - "scripts": { - "lint": "npm run lint:lwc", - "lint:lwc": "eslint **/lwc/**", - "test": "npm run test:unit", - "test:unit": "sfdx-lwc-jest --skipApiVersionCheck", - "test:unit:watch": "sfdx-lwc-jest --watch --skipApiVersionCheck", - "test:unit:debug": "sfdx-lwc-jest --debug --skipApiVersionCheck", - "test:unit:coverage": "sfdx-lwc-jest --coverage --skipApiVersionCheck", - "prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", - "prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", - "postinstall": "husky install", - "precommit": "lint-staged" - }, - "lint-staged": { - "**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}": [ - "prettier --write" - ], - "**/{aura,lwc}/**": [ - "eslint" - ], - "**/lwc/**": [ - "sfdx-lwc-jest --skipApiVersionCheck -- --bail --findRelatedTests" - ] - }, - "author": "salesforce.com", - "license": "CC0-1.0", - "repository": { - "type": "git", - "url": "git+https://github.com/trailheadapps/ebikes-lwc" - }, - "devDependencies": { - "@lwc/eslint-plugin-lwc": "^1.0.1", - "@prettier/plugin-xml": "^0.13.1", - "@sa11y/jest": "^0.3.1", - "@salesforce/eslint-config-lwc": "^2.0.0", - "@salesforce/eslint-plugin-lightning": "^0.1.1", - "@salesforce/sfdx-lwc-jest": "^0.10.4", - "eslint": "^7.28.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.23.4", - "eslint-plugin-jest": "^24.3.6", - "husky": "^6.0.0", - "lint-staged": "^11.0.0", - "prettier": "^2.3.1", - "prettier-plugin-apex": "^1.9.1" - }, - "volta": { - "node": "14.17.3", - "npm": "6.14.13" - } -} diff --git a/test/nuts/ebikes-lwc/sfdx-project.json b/test/nuts/ebikes-lwc/sfdx-project.json deleted file mode 100644 index 3dfed9beb..000000000 --- a/test/nuts/ebikes-lwc/sfdx-project.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "packageDirectories": [ - { - "path": "force-app", - "default": true - } - ], - "namespace": "", - "sourceApiVersion": "52.0" -} diff --git a/test/nuts/generateNuts.ts b/test/nuts/generateNuts.ts index 682453454..329bcb777 100644 --- a/test/nuts/generateNuts.ts +++ b/test/nuts/generateNuts.ts @@ -12,6 +12,7 @@ import * as shelljs from 'shelljs'; import { EXECUTABLES, RepoConfig, TEST_REPOS_MAP } from './testMatrix'; const SEED_FILTER = process.env.PLUGIN_SOURCE_SEED_FILTER || ''; +const SEED_EXCLUDE = process.env.PLUGIN_SOURCE_SEED_EXCLUDE; function getSeedFiles(): string[] { const seedDir = path.join(__dirname, 'seeds'); @@ -19,6 +20,7 @@ function getSeedFiles(): string[] { return files .filter((f) => f.endsWith('.seed.ts')) .filter((f) => f.includes(SEED_FILTER)) + .filter((f) => !SEED_EXCLUDE || !f.includes(SEED_EXCLUDE)) .map((f) => path.resolve(path.join(seedDir, f))); } diff --git a/test/nuts/trackingCommands/basics.nut.ts b/test/nuts/trackingCommands/basics.nut.ts index c092ff8a5..e7685e843 100644 --- a/test/nuts/trackingCommands/basics.nut.ts +++ b/test/nuts/trackingCommands/basics.nut.ts @@ -10,29 +10,31 @@ import * as path from 'path'; import * as fs from 'fs'; import { expect } from 'chai'; - +import * as shelljs from 'shelljs'; import { TestSession, execCmd } from '@salesforce/cli-plugins-testkit'; -import { Env } from '@salesforce/kit'; -import { ensureString } from '@salesforce/ts-types'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; import { replaceRenamedCommands } from '@salesforce/source-tracking'; -import { DeployCommandResult } from '../../../src/formatters/deployResultFormatter'; +import { PushResponse } from '../../../src/formatters/pushResultFormatter'; import { StatusResult } from '../../../src/formatters/statusFormatter'; import { PullResponse } from '../../../src/formatters/pullFormatter'; let session: TestSession; -let hubUsername: string; describe('end-to-end-test for tracking with an org (single packageDir)', () => { - const env = new Env(); - before(async () => { session = await TestSession.create({ project: { - sourceDir: path.join('test', 'nuts', 'ebikes-lwc'), + gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, - setupCommands: [`sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`], + setupCommands: [ + // 'git checkout 652b954921f51c79371c224760dd5bdf6a277db5', + `sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`, + ], }); - hubUsername = ensureString(env.getString('TESTKIT_HUB_USERNAME')); + + // we also need to remove profiles from the forceignore + const originalForceIgnore = await fs.promises.readFile(path.join(session.project.dir, '.forceignore'), 'utf8'); + const newForceIgnore = originalForceIgnore.replace('**/profiles/**', ''); + await fs.promises.writeFile(path.join(session.project.dir, '.forceignore'), newForceIgnore); }); after(async () => { @@ -50,13 +52,13 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { expect(result.every((row) => row.type && row.fullName)).to.equal(true); }); it('pushes the initial metadata to the org', () => { - const result = execCmd(replaceRenamedCommands('force:source:push --json'), { + const result = execCmd(replaceRenamedCommands('force:source:push --json'), { ensureExitCode: 0, }).jsonOutput.result; - expect(result.deployedSource).to.be.an.instanceof(Array); - expect(result.deployedSource, JSON.stringify(result)).to.have.lengthOf(234); + expect(result).to.be.an.instanceof(Array); + expect(result, JSON.stringify(result)).to.have.lengthOf(234); expect( - result.deployedSource.every((r) => r.state !== ComponentStatus.Failed), + result.every((r) => r.state !== ComponentStatus.Failed), JSON.stringify(result) ).to.equal(true); }); @@ -69,7 +71,6 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { const remoteResult = execCmd(replaceRenamedCommands('force:source:status --json --remote'), { ensureExitCode: 0, }).jsonOutput.result; - expect(remoteResult.length).to.equal(1); expect(remoteResult.some((item) => item.type === 'Profile')).to.equal(true); }); @@ -77,14 +78,20 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { const pullResult = execCmd(replaceRenamedCommands('force:source:pull --json'), { ensureExitCode: 0, }).jsonOutput.result; - expect(pullResult.some((item) => item.type === 'Profile')).to.equal(true); + expect( + pullResult.some((item) => item.type === 'Profile'), + JSON.stringify(pullResult) + ).to.equal(true); }); it('sees no local or remote changes', () => { const result = execCmd(replaceRenamedCommands('force:source:status --json'), { ensureExitCode: 0, }).jsonOutput.result; - expect(result).to.have.length(0); + expect( + result.filter((r) => r.type === 'Profile'), + JSON.stringify(result) + ).to.have.length(0); }); it('sees a local delete in local status', async () => { @@ -99,15 +106,21 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { expect(result).to.deep.equal([ { type: 'ApexClass', - state: 'local Delete', + state: 'Local Deleted', fullName: 'TestOrderController', - filepath: path.normalize('force-app/main/default/classes/TestOrderController.cls'), + filePath: path.normalize('force-app/main/default/classes/TestOrderController.cls'), + ignored: false, + actualState: 'Deleted', + origin: 'Local', }, { type: 'ApexClass', - state: 'local Delete', + state: 'Local Deleted', fullName: 'TestOrderController', - filepath: path.normalize('force-app/main/default/classes/TestOrderController.cls-meta.xml'), + filePath: path.normalize('force-app/main/default/classes/TestOrderController.cls-meta.xml'), + ignored: false, + actualState: 'Deleted', + origin: 'Local', }, ]); }); @@ -115,41 +128,68 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { const result = execCmd(replaceRenamedCommands('force:source:status --json --remote'), { ensureExitCode: 0, }).jsonOutput.result; - expect(result).to.have.length(0); + expect( + result.filter((r) => r.fullName === 'TestOrderController'), + JSON.stringify(result) + ).to.have.length(0); }); it('pushes the local delete to the org', () => { - const result = execCmd(replaceRenamedCommands('force:source:push --json'), { + const result = execCmd(replaceRenamedCommands('force:source:push --json'), { ensureExitCode: 0, }).jsonOutput.result; - expect(result.deployedSource).to.be.an.instanceof(Array).with.length(2); + expect(result, JSON.stringify(result)).to.be.an.instanceof(Array).with.length(2); }); it('sees no local changes', () => { const result = execCmd(replaceRenamedCommands('force:source:status --json --local'), { ensureExitCode: 0, }).jsonOutput.result; - expect(result).to.be.an.instanceof(Array).with.length(0); + expect(result, JSON.stringify(result)).to.be.an.instanceof(Array).with.length(0); }); }); describe('non-successes', () => { it('should throw an err when attempting to pull from a non scratch-org', () => { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access + const hubUsername = ( + JSON.parse(shelljs.exec('sfdx force:config:get defaultdevhubusername --json', { silent: true })) as { + result: [{ location: string; value: string }]; + } + ).result.find((config) => config.location === 'Local').value; const failure = execCmd(replaceRenamedCommands(`force:source:status -u ${hubUsername} --remote --json`), { ensureExitCode: 1, }).jsonOutput as unknown as { name: string }; expect(failure.name).to.equal('NonSourceTrackedOrgError'); }); - it('should not poll for SourceMembers when SFDX_DISABLE_SOURCE_MEMBER_POLLING=true'); - - describe('push partial success', () => { - it('can deploy source with some failures and show correct exit code'); - it('can see failures remaining in local tracking, but successes are gone'); - }); describe('push failures', () => { - it('handles failed push'); - it('has no changes to local tracking'); + it('writes a bad class', async () => { + const classdir = path.join(session.project.dir, 'force-app', 'main', 'default', 'classes'); + // add a file in the local source + await Promise.all([ + fs.promises.writeFile(path.join(classdir, 'badClass.cls'), 'bad'), + fs.promises.writeFile( + path.join(classdir, 'badClass.cls-meta.xml'), + ` + + 53.0 +` + ), + ]); + }); + it('fails to push', () => { + const result = execCmd(replaceRenamedCommands('force:source:push --json'), { + ensureExitCode: 1, + }).jsonOutput.result; + expect(result.every((r) => r.type === 'ApexClass' && r.state === 'Failed')).to.equal(true); + }); + it('classes that failed to deploy are still in local status', () => { + it('sees no local changes', () => { + const result = execCmd(replaceRenamedCommands('force:source:status --json --local'), { + ensureExitCode: 0, + }).jsonOutput.result; + expect(result, JSON.stringify(result)).to.be.an.instanceof(Array).with.length(2); + }); + }); }); }); }); diff --git a/test/nuts/trackingCommands/conflicts.nut.ts b/test/nuts/trackingCommands/conflicts.nut.ts index 722bab5dc..902e925f5 100644 --- a/test/nuts/trackingCommands/conflicts.nut.ts +++ b/test/nuts/trackingCommands/conflicts.nut.ts @@ -17,7 +17,7 @@ import { TestSession, execCmd } from '@salesforce/cli-plugins-testkit'; import { Connection, AuthInfo } from '@salesforce/core'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; import { replaceRenamedCommands } from '@salesforce/source-tracking'; -import { DeployCommandResult } from '../../../src/formatters/deployResultFormatter'; +import { PushResponse } from '../../../src/formatters/pushResultFormatter'; import { StatusResult } from '../../../src/formatters/statusFormatter'; import { PullResponse } from '../../../src/formatters/pullFormatter'; @@ -26,9 +26,12 @@ describe('conflict detection and resolution', () => { before(async () => { session = await TestSession.create({ project: { - sourceDir: path.join('test', 'nuts', 'ebikes-lwc'), + gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, - setupCommands: [`sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`], + setupCommands: [ + 'git checkout 652b954921f51c79371c224760dd5bdf6a277db5', + `sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`, + ], }); }); @@ -39,12 +42,12 @@ describe('conflict detection and resolution', () => { it('pushes to initiate the remote', () => { // This would go in setupCommands but we want it to use the bin/run version - const pushResult = execCmd(replaceRenamedCommands('force:source:push --json'), { + const pushResult = execCmd(replaceRenamedCommands('force:source:push --json'), { ensureExitCode: 0, }).jsonOutput.result; - expect(pushResult.deployedSource, JSON.stringify(pushResult)).to.have.lengthOf(234); + expect(pushResult, JSON.stringify(pushResult)).to.have.lengthOf(234); expect( - pushResult.deployedSource.every((r) => r.state !== ComponentStatus.Failed), + pushResult.every((r) => r.state !== ComponentStatus.Failed), JSON.stringify(pushResult) ).to.equal(true); }); @@ -52,7 +55,7 @@ describe('conflict detection and resolution', () => { it('edits a remote file', async () => { const conn = await Connection.create({ authInfo: await AuthInfo.create({ - username: (session.setup[0] as { result: { username: string } }).result?.username, + username: (session.setup[1] as { result: { username: string } }).result?.username, }), }); const app = await conn.singleRecordQuery<{ Id: string; Metadata: any }>( @@ -71,8 +74,10 @@ describe('conflict detection and resolution', () => { const result = execCmd(replaceRenamedCommands('force:source:status --json --remote'), { ensureExitCode: 0, }).jsonOutput.result; - // profile and customApplication - expect(result, JSON.stringify(result)).to.have.lengthOf(2); + expect( + result.filter((r) => r.type === 'CustomApplication'), + JSON.stringify(result) + ).to.have.lengthOf(1); }); it('edits a local file', async () => { const filePath = path.join( @@ -89,20 +94,42 @@ describe('conflict detection and resolution', () => { ); }); it('can see the conflict in status', () => { - const result = execCmd(replaceRenamedCommands('force:source:status --json'), { ensureExitCode: 0 }) - .jsonOutput.result; - expect(result, JSON.stringify(result)).to.have.lengthOf(3); - result.filter((app) => app.type === 'CustomApplication').map((app) => expect(app.state).to.include('(Conflict)')); + const result = execCmd(replaceRenamedCommands('force:source:status --json'), { + ensureExitCode: 0, + }).jsonOutput.result.filter((app) => app.type === 'CustomApplication'); + // json is not sorted. This relies on the implementation of getConflicts() + expect(result).to.deep.equal([ + { + type: 'CustomApplication', + state: 'Local Changed (Conflict)', + fullName: 'EBikes', + filePath: path.normalize('force-app/main/default/applications/EBikes.app-meta.xml'), + ignored: false, + conflict: true, + origin: 'Local', + actualState: 'Changed', + }, + { + type: 'CustomApplication', + state: 'Remote Changed (Conflict)', + fullName: 'EBikes', + filePath: path.normalize('force-app/main/default/applications/EBikes.app-meta.xml'), + ignored: false, + conflict: true, + origin: 'Remote', + actualState: 'Changed', + }, + ]); }); it('gets conflict error on push', () => { - execCmd(replaceRenamedCommands('force:source:push --json'), { ensureExitCode: 1 }); + execCmd(replaceRenamedCommands('force:source:push --json'), { ensureExitCode: 1 }); }); it('gets conflict error on pull', () => { execCmd(replaceRenamedCommands('force:source:pull --json'), { ensureExitCode: 1 }); }); it('can push with forceoverwrite', () => { - execCmd(replaceRenamedCommands('force:source:push --json --forceoverwrite'), { + execCmd(replaceRenamedCommands('force:source:push --json --forceoverwrite'), { ensureExitCode: 0, }); }); diff --git a/test/nuts/trackingCommands/forceIgnore.nut.ts b/test/nuts/trackingCommands/forceIgnore.nut.ts index 0ff6eb536..922be652c 100644 --- a/test/nuts/trackingCommands/forceIgnore.nut.ts +++ b/test/nuts/trackingCommands/forceIgnore.nut.ts @@ -19,7 +19,7 @@ import { TestSession, execCmd } from '@salesforce/cli-plugins-testkit'; import { Connection, AuthInfo } from '@salesforce/core'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; import { replaceRenamedCommands } from '@salesforce/source-tracking'; -import { DeployCommandResult } from '../../../src/formatters/deployResultFormatter'; +import { PushResponse } from '../../../src/formatters/pushResultFormatter'; import { PullResponse } from '../../../src/formatters/pullFormatter'; import { StatusResult } from '../../../src/formatters/statusFormatter'; @@ -32,7 +32,7 @@ describe('forceignore changes', () => { before(async () => { session = await TestSession.create({ project: { - name: 'IgnoreProject', + name: 'forceIngoreTest', }, setupCommands: [ `sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`, @@ -58,10 +58,26 @@ describe('forceignore changes', () => { const newForceIgnore = originalForceIgnore + '\n' + `${classdir}/IgnoreTest.cls`; await fs.promises.writeFile(path.join(session.project.dir, '.forceignore'), newForceIgnore); // nothing should push - const output = execCmd(replaceRenamedCommands('force:source:push --json'), { + const output = execCmd(replaceRenamedCommands('force:source:push --json'), { ensureExitCode: 0, }).jsonOutput.result; - expect(output.deployedSource).to.deep.equal([]); + expect(output).to.deep.equal([]); + }); + + it('shows the file in status as ignored', () => { + const output = execCmd(replaceRenamedCommands('force:source:status --json'), { + ensureExitCode: 0, + }).jsonOutput.result; + expect(output, JSON.stringify(output)).to.deep.include({ + state: 'Local Add', + fullName: 'IgnoreTest', + type: 'ApexClass', + origin: 'Local', + filePath: path.join(classdir, 'IgnoreTest.cls'), + ignored: true, + conflict: false, + actualState: 'Add', + }); }); it('will ignore a class in the ignore file before it was created', async () => { @@ -76,11 +92,11 @@ describe('forceignore changes', () => { silent: true, }); // pushes with no results - const ignoredOutput = execCmd(replaceRenamedCommands('force:source:push --json'), { + const ignoredOutput = execCmd(replaceRenamedCommands('force:source:push --json'), { ensureExitCode: 0, }).jsonOutput.result; // nothing should have been pushed - expect(ignoredOutput.deployedSource).to.deep.equal([]); + expect(ignoredOutput).to.deep.equal([]); }); it('will push files that are now un-ignored', async () => { @@ -88,13 +104,13 @@ describe('forceignore changes', () => { await fs.promises.writeFile(path.join(session.project.dir, '.forceignore'), originalForceIgnore); // verify file pushed in results - const unIgnoredOutput = execCmd(replaceRenamedCommands('force:source:push --json'), { + const unIgnoredOutput = execCmd(replaceRenamedCommands('force:source:push --json'), { ensureExitCode: 0, }).jsonOutput.result; // all 4 files should have been pushed - expect(unIgnoredOutput.deployedSource).to.have.length(4); - unIgnoredOutput.deployedSource.map((result) => { + expect(unIgnoredOutput).to.have.length(4); + unIgnoredOutput.map((result) => { expect(result.type === 'ApexClass'); expect(result.state === ComponentStatus.Created); }); diff --git a/test/nuts/trackingCommands/remoteChanges.nut.ts b/test/nuts/trackingCommands/remoteChanges.nut.ts index 522a931a8..25a43bcb9 100644 --- a/test/nuts/trackingCommands/remoteChanges.nut.ts +++ b/test/nuts/trackingCommands/remoteChanges.nut.ts @@ -17,7 +17,7 @@ import { TestSession, execCmd } from '@salesforce/cli-plugins-testkit'; import { Connection, AuthInfo } from '@salesforce/core'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; import { replaceRenamedCommands } from '@salesforce/source-tracking'; -import { DeployCommandResult } from '../../../src/formatters/deployResultFormatter'; +import { PushResponse } from '../../../src/formatters/pushResultFormatter'; import { StatusResult } from '../../../src/formatters/statusFormatter'; import { PullResponse } from '../../../src/formatters/pullFormatter'; @@ -28,13 +28,16 @@ describe('remote changes', () => { before(async () => { session = await TestSession.create({ project: { - sourceDir: path.join('test', 'nuts', 'ebikes-lwc'), + gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, - setupCommands: [`sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`], + setupCommands: [ + 'git checkout 652b954921f51c79371c224760dd5bdf6a277db5', + `sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`, + ], }); conn = await Connection.create({ authInfo: await AuthInfo.create({ - username: (session.setup[0] as { result: { username: string } }).result?.username, + username: (session.setup[1] as { result: { username: string } }).result?.username, }), }); }); @@ -46,12 +49,12 @@ describe('remote changes', () => { describe('remote changes: delete', () => { it('pushes to initiate the remote', () => { - const pushResult = execCmd(replaceRenamedCommands('force:source:push --json'), { + const pushResult = execCmd(replaceRenamedCommands('force:source:push --json'), { ensureExitCode: 0, }).jsonOutput.result; - expect(pushResult.deployedSource, JSON.stringify(pushResult)).to.have.lengthOf(234); + expect(pushResult, JSON.stringify(pushResult)).to.have.lengthOf(234); expect( - pushResult.deployedSource.every((r) => r.state !== ComponentStatus.Failed), + pushResult.every((r) => r.state !== ComponentStatus.Failed), JSON.stringify(pushResult) ).to.equal(true); }); @@ -85,20 +88,23 @@ describe('remote changes', () => { ensureExitCode: 0, }).jsonOutput.result; // it shows up as one class on the server, but 2 files when pulled - expect(result.filter((r) => r.state.includes('Delete'))).to.have.length(1); + expect( + result.filter((r) => r.state.includes('Delete')), + JSON.stringify(result) + ).to.have.length(1); }); it('does not see any change in local status', () => { const result = execCmd(replaceRenamedCommands('force:source:status --json --local'), { ensureExitCode: 0, }).jsonOutput.result; - expect(result).to.have.length(0); + expect(result).to.deep.equal([]); }); it('can pull the delete', () => { const result = execCmd(replaceRenamedCommands('force:source:pull --json'), { ensureExitCode: 0 }) .jsonOutput.result; // the 2 files for the apexClass, and possibly one for the Profile (depending on whether it got created in time) - expect(result).to.have.length.greaterThanOrEqual(2); - expect(result).to.have.length.lessThanOrEqual(3); + expect(result, JSON.stringify(result)).to.have.length.greaterThanOrEqual(2); + expect(result, JSON.stringify(result)).to.have.length.lessThanOrEqual(4); result.filter((r) => r.fullName === 'TestOrderController').map((r) => expect(r.state).to.equal('Deleted')); }); it('local file was deleted', () => { @@ -117,19 +123,20 @@ describe('remote changes', () => { const remoteResult = execCmd(replaceRenamedCommands('force:source:status --json --remote'), { ensureExitCode: 0, }).jsonOutput.result; - expect(remoteResult.filter((r) => r.state.includes('Remote Deleted'))).to.have.length(0); + expect(remoteResult.filter((r) => r.state.includes('Remote Deleted'))).to.deep.equal([]); const localStatus = execCmd(replaceRenamedCommands('force:source:status --json --local'), { ensureExitCode: 0, }).jsonOutput.result; - expect(localStatus).to.have.length(0); + expect(localStatus).to.deep.equal([]); }); }); describe('remote changes: add', () => { + const className = 'CreatedClass'; it('adds on the server', async () => { const createResult = await conn.tooling.create('ApexClass', { - Name: 'CreatedClass', + Name: className, Body: 'public class CreatedClass {}', Status: 'Active', }); @@ -141,27 +148,30 @@ describe('remote changes', () => { const result = execCmd(replaceRenamedCommands('force:source:status --json --remote'), { ensureExitCode: 0, }).jsonOutput.result; - // it shows up as one class on the server, plus Admin Profile - expect(result.filter((r) => r.state.includes('Add'))).to.have.length(2); - expect(result.some((r) => r.fullName === 'CreatedClass')).to.equal(true); + expect( + result.some((r) => r.fullName === className), + JSON.stringify(result) + ).to.equal(true); }); it('can pull the add', () => { const result = execCmd(replaceRenamedCommands('force:source:pull --json'), { ensureExitCode: 0 }) .jsonOutput.result; - expect(result).to.have.length(3); // 2 files for the apexClass, plus AdminProfile // SDR marks all retrieves as 'Changed' even if it creates new local files. This is different from toolbelt, which marked those as 'Created' - result.filter((r) => r.fullName === 'CreatedClass').map((r) => expect(r.state).to.equal('Changed')); + result.filter((r) => r.fullName === className).map((r) => expect(r.state, JSON.stringify(r)).to.equal('Created')); }); it('sees correct local and remote status', () => { const remoteResult = execCmd(replaceRenamedCommands('force:source:status --json --remote'), { ensureExitCode: 0, }).jsonOutput.result; - expect(remoteResult).to.have.length(0); + expect( + remoteResult.filter((r) => r.fullName === className), + JSON.stringify(remoteResult) + ).deep.equal([]); const localStatus = execCmd(replaceRenamedCommands('force:source:status --json --local'), { ensureExitCode: 0, }).jsonOutput.result; - expect(localStatus).to.have.length(0); + expect(localStatus).to.deep.equal([]); }); }); diff --git a/test/nuts/trackingCommands/resetClear.nut.ts b/test/nuts/trackingCommands/resetClear.nut.ts index 8037aa19e..b358489a0 100644 --- a/test/nuts/trackingCommands/resetClear.nut.ts +++ b/test/nuts/trackingCommands/resetClear.nut.ts @@ -44,15 +44,18 @@ describe('reset and clear', () => { before(async () => { session = await TestSession.create({ project: { - sourceDir: path.join('test', 'nuts', 'ebikes-lwc'), + gitClone: 'https://github.com/trailheadapps/ebikes-lwc', }, - setupCommands: [`sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`], + setupCommands: [ + 'git checkout 652b954921f51c79371c224760dd5bdf6a277db5', + `sfdx force:org:create -d 1 -s -f ${path.join('config', 'project-scratch-def.json')}`, + ], }); - orgId = (session.setup[0] as { result: { orgId: string } }).result?.orgId; + orgId = (session.setup[1] as { result: { orgId: string } }).result?.orgId; trackingFileFolder = path.join(session?.project.dir, '.sfdx', 'orgs', orgId); conn = await Connection.create({ authInfo: await AuthInfo.create({ - username: (session.setup[0] as { result: { username: string } }).result?.username, + username: (session.setup[1] as { result: { username: string } }).result?.username, }), }); }); diff --git a/tsconfig.json b/tsconfig.json index 12618d122..a99f03279 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,13 @@ "extends": "@salesforce/dev-config/tsconfig", "compilerOptions": { "outDir": "lib", - "rootDir": "src" + "rootDir": "src", + "baseUrl": ".", + "paths": { + "@salesforce/kit": ["node_modules/@salesforce/kit"], + "@salesforce/source-deploy-retrieve": ["node_modules/@salesforce/source-deploy-retrieve"], + "@salesforce/core": ["node_modules/@salesforce/core"] + } }, "include": ["./src/**/*.ts"] } diff --git a/yarn.lock b/yarn.lock index bd4d92417..4a5d09506 100644 --- a/yarn.lock +++ b/yarn.lock @@ -808,7 +808,7 @@ resolved "https://registry.npmjs.org/@salesforce/schemas/-/schemas-1.1.0.tgz#bbf94a11ee036f2b0ec6ba82306cd9565a6ba26b" integrity sha512-6D7DvE6nFxpLyyTnrOIbbAeCJw2r/EpinFAcMh6gU0gA/CGfSbwV/8uR3uHLYL2zCyCZLH8jJ4dZ3BzCMqc+Eg== -"@salesforce/source-deploy-retrieve@^4.0.2", "@salesforce/source-deploy-retrieve@^4.5.2": +"@salesforce/source-deploy-retrieve@^4.0.2": version "4.5.2" resolved "https://registry.npmjs.org/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-4.5.2.tgz#4fbc3c40f1d3631885b26dd39d943b430a720b38" integrity sha512-McUQSZRQJCUPokmt8n7KJffeN6gPiHQzyl7r7QoHFzteEVm0ual/alS3749KSxPHHb8qjTxJq3sXOPpG0a4gKg== @@ -823,6 +823,22 @@ unzipper "0.10.11" xmldom-sfdx-encoding "^0.1.29" +"@salesforce/source-deploy-retrieve@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-5.0.1.tgz#b4add87b3de0cb27e2432e64638ef145ae81d561" + integrity sha512-dcQv0ehKyXs+TzX/gHLhs1pV+cC2VmwsYe+sRjrqTxKsQ5qo+ByF8FhkbwtlYLdUOpRkaIS+/JwCpEwKgPKvKg== + dependencies: + "@salesforce/core" "2.28.0" + "@salesforce/kit" "^1.5.0" + "@salesforce/ts-types" "^1.4.2" + archiver "^5.3.0" + fast-xml-parser "^3.17.4" + graceful-fs "^4.2.8" + ignore "^5.1.8" + mime "2.4.6" + unzipper "0.10.11" + xmldom-sfdx-encoding "^0.1.29" + "@salesforce/source-testkit@^0.0.15": version "0.0.15" resolved "https://registry.npmjs.org/@salesforce/source-testkit/-/source-testkit-0.0.15.tgz#0587a4cb050cd4f52c292c5aae164f2d09d3f5ee" @@ -840,15 +856,14 @@ sinon "^10.0.0" strip-ansi "^6.0.0" -"@salesforce/source-tracking@^0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@salesforce/source-tracking/-/source-tracking-0.2.2.tgz#c1d0da0dfe382ef2ba4f07caac01c011ad34e816" - integrity sha512-Ih6dZDEYwFqm1wjrvqJTArreHbRQmYLCRgOBPTrEOirtk22QpjKWHbIpCWgEjAIybuZlDKdO1+BnZ/Cq8Zt+xQ== +"@salesforce/source-tracking@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@salesforce/source-tracking/-/source-tracking-0.4.0.tgz#fef1d22de4996967c57f15e4a14a0c5677e941de" + integrity sha512-7G4fdoMk921dSIkNzsZOmnI/YU4H+V+jRgAe2INMDs1oc8QmsQ6pgTDfV3OlzANPio4OVJDEzhYxyxjdCxMKXQ== dependencies: - "@oclif/config" "^1.17.0" "@salesforce/core" "^2.28.0" "@salesforce/kit" "^1.5.17" - "@salesforce/source-deploy-retrieve" "^4.5.2" + "@salesforce/source-deploy-retrieve" "^5.0.1" isomorphic-git "^1.9.2" ts-retry-promise "^0.6.0" @@ -2267,6 +2282,13 @@ create-require@^1.1.0: resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +cross-env@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" + integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== + dependencies: + cross-spawn "^7.0.1" + cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -2278,7 +2300,7 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -3782,7 +3804,7 @@ got@^6.2.0: unzip-response "^2.0.1" url-parse-lax "^1.0.0" -graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4: +graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4, graceful-fs@^4.2.8: version "4.2.8" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==