Skip to content

Commit 18b23f4

Browse files
authored
chore: add sfdx project for functional testing @W-18175074 (#391)
1 parent bd28f10 commit 18b23f4

File tree

13 files changed

+204
-0
lines changed

13 files changed

+204
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
2+
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
3+
#
4+
5+
package.xml
6+
7+
# LWC configuration files
8+
**/jsconfig.json
9+
**/.eslintrc.json
10+
11+
# LWC Jest
12+
**/__tests__/**
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This file is used for Git repositories to specify intentionally untracked files that Git should ignore.
2+
# If you are not using git, you can delete this file. For more information see: https://git-scm.com/docs/gitignore
3+
# For useful gitignore templates see: https://github.com/github/gitignore
4+
5+
# Salesforce cache
6+
.sf/
7+
.sfdx/
8+
.localdevserver/
9+
deploy-options.json
10+
11+
# LWC VSCode autocomplete
12+
**/lwc/jsconfig.json
13+
14+
# LWC Jest coverage reports
15+
coverage/
16+
17+
# Logs
18+
logs
19+
*.log
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
24+
# Dependency directories
25+
node_modules/
26+
27+
# Eslint cache
28+
.eslintcache
29+
30+
# MacOS system files
31+
.DS_Store
32+
33+
# Windows system files
34+
Thumbs.db
35+
ehthumbs.db
36+
[Dd]esktop.ini
37+
$RECYCLE.BIN/
38+
39+
# Local environment variables
40+
.env
41+
42+
# Python Salesforce Functions
43+
**/__pycache__/
44+
**/.venv/
45+
**/venv/
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# List files or directories below to ignore them when running prettier
2+
# More information: https://prettier.io/docs/en/ignore.html
3+
#
4+
5+
**/staticresources/**
6+
.localdevserver
7+
.sfdx
8+
.sf
9+
.vscode
10+
11+
coverage/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Salesforce DX Project: Next Steps
2+
3+
Now that you’ve created a Salesforce DX project, what’s next? Here are some documentation resources to get you started.
4+
5+
## How Do You Plan to Deploy Your Changes?
6+
7+
Do you want to deploy a set of changes, or create a self-contained application? Choose a [development model](https://developer.salesforce.com/tools/vscode/en/user-guide/development-models).
8+
9+
## Configure Your Salesforce DX Project
10+
11+
The `sfdx-project.json` file contains useful configuration information for your project. See [Salesforce DX Project Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm) in the _Salesforce DX Developer Guide_ for details about this file.
12+
13+
## Read All About It
14+
15+
- [Salesforce Extensions Documentation](https://developer.salesforce.com/tools/vscode/)
16+
- [Salesforce CLI Setup Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm)
17+
- [Salesforce DX Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_intro.htm)
18+
- [Salesforce CLI Command Reference](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference.htm)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"orgName": "HMRtest",
3+
"edition": "Developer",
4+
"features": ["EnableSetPasswordInApi"],
5+
"settings": {
6+
"lightningExperienceSettings": {
7+
"enableS1DesktopEnabled": true
8+
},
9+
"mobileSettings": {
10+
"enableS1EncryptedStoragePref2": false
11+
}
12+
}
13+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { createElement } from 'lwc';
2+
import HmrTest from 'c/hmrTest';
3+
4+
describe('c-hmr-test', () => {
5+
afterEach(() => {
6+
// The jsdom instance is shared across test cases in a single file so reset the DOM
7+
while (document.body.firstChild) {
8+
document.body.removeChild(document.body.firstChild);
9+
}
10+
});
11+
12+
it('TODO: test case generated by CLI command, please fill in test logic', () => {
13+
// Arrange
14+
const element = createElement('c-hmr-test', {
15+
is: HmrTest,
16+
});
17+
18+
// Act
19+
document.body.appendChild(element);
20+
21+
// Assert
22+
// const div = element.shadowRoot.querySelector('div');
23+
expect(1).toBe(1);
24+
});
25+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.important-text {
2+
font-weight: bold;
3+
color: blue;
4+
padding-bottom: 10px;
5+
}
6+
7+
.footer-text {
8+
font-style: italic;
9+
color: grey;
10+
font-size: 0.8rem;
11+
}
12+
13+
/* Add more styles here later to test HMR */
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<template>
2+
<lightning-card title="HMR Test Component - Enhanced" icon-name="custom:custom14">
3+
<div class="slds-m-around_medium">
4+
<p class="important-text">Hello from HMR Test!</p>
5+
<p>Current Count: {counter}</p>
6+
<lightning-button label="Increment" onclick="{handleIncrement}"></lightning-button>
7+
<br /><br />
8+
<lightning-badge label="HMR Active"></lightning-badge>
9+
<br /><br />
10+
<lightning-input label="Sample Input" placeholder="Type something..."></lightning-input>
11+
</div>
12+
<p class="footer-text slds-m-around_medium">Some text to modify for HMR.</p>
13+
</lightning-card>
14+
</template>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { LightningElement, track } from 'lwc';
2+
3+
export default class HmrTest extends LightningElement {
4+
@track counter = 0;
5+
6+
handleIncrement() {
7+
this.counter++;
8+
}
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<apiVersion>59.0</apiVersion>
4+
<isExposed>true</isExposed>
5+
<targets>
6+
<target>lightning__AppPage</target>
7+
<target>lightning__HomePage</target>
8+
<target>lightning__RecordPage</target>
9+
</targets>
10+
</LightningComponentBundle>

0 commit comments

Comments
 (0)