Skip to content

Instantly share code, notes, and snippets.

View kmesic's full-sized avatar
🎧

Kenan Mesic kmesic

🎧
View GitHub Profile
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
*/
import {
helloWorld,
getData,
specialMap
} from '../utils';
// Basic Example
describe('Hello World', () => {
const SALESFORCE = "Salesforce";
import { LightningElement } from 'lwc';
export default class ComponentA extends LightningElement {
fireEvent() {
// Fire DOM custom event
const customEvt = new CustomEvent('custom');
this.dispatchEvent(customEvt);
}
}
img.product {
height: 120px;
max-width: initial;
pointer-events: none;
}
/**
* 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