This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createElement } from 'lwc'; | |
import HelloWorld from 'c/helloWorld'; | |
/** | |
* We actually don't need to this, as sfdx-lwc-jest will automock to a value, but better to be specific | |
* and to show how to mock out certain GVPs | |
* | |
* How lwc-jest transforms GVPs: | |
* https://github.com/salesforce/lwc-test/blob/master/packages/%40lwc/jest-transformer/src/transforms/utils.js | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
helloWorld, | |
getData, | |
specialMap | |
} from '../utils'; | |
// Basic Example | |
describe('Hello World', () => { | |
const SALESFORCE = "Salesforce"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LightningElement } from 'lwc'; | |
export default class ComponentA extends LightningElement { | |
fireEvent() { | |
// Fire DOM custom event | |
const customEvt = new CustomEvent('custom'); | |
this.dispatchEvent(customEvt); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img.product { | |
height: 120px; | |
max-width: initial; | |
pointer-events: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A basic pub-sub mechanism for sibling component communication | |
* | |
* TODO - adopt standard flexipage sibling communication mechanism when it's available. | |
*/ | |
const events = {}; | |
/** | |
* Registers a callback for an event |