1.0.0 • Published 3 years ago

lwc-wire-service-sfdc-mocks v1.0.0

Weekly downloads
7
License
MIT
Repository
-
Last release
3 years ago

Lightning Data Service and UI API Mocks for Wire Service

This is a mock implementation of Lightning Data Service wire adapters. By providing mock adapters, metadata and data, "off core" development becomes possible. You can develop Lightning web components that use @wire for any LDS data source without access to a Salesforce server or core code.

Refer to the LWC developer guide for documentation on the wire service.

Supported data types

  1. @wire(getRecord, { ... })
  2. @wire(getObjectInfo, { ... })
  3. @wire(getPicklistValues, { ... })
  4. @wire(getPicklistValuesByRecordType, { ... })
  5. @wire(getRecordUi, { ... })
  6. @wire(getRecordCreateDefaults, { ... })

See the Salesforce Data and Metadata for documentation on these data types.

The following types are supported but their adapter id and meta/data shape is not finalized.

  1. @wire(getGlobalActions, { ... })
  2. @wire(getRecordActions, { ... })
  3. @wire(getRecordEditActions, { ... })
  4. @wire(getRelatedListActions, { ... })
  5. @wire(getRelatedListRecordActions, { ... })
  6. @wire(getListViewHeaderActions, { ... })
  7. @wire(getListViewRecordActions, { ... })
  8. @wire(getListViewChartActions, { ... })
  9. @wire(getLightningPageActions, { ... })
  10. @wire(getLookupActions, { ... })
  11. @wire(getMruListActions, { ... })
  12. @wire(getPhotoActions, { ... })
  13. @wire(getLookupRecords, { ... })

Installation

1) Add dependency on this module

yarn add -D lwc-wire-service-sfdc-mocks

2) Register the mocks

Register the mocks before creating the root LWC component. For example:

import * as lwc from 'lwc';
import App from 'x-my-app';

// ADD THIS
import { registerMockedWireService } from 'lwc-wire-service-sfdc-mocks';
registerMockedWireService(lwc);

const container = document.getElementById('main');
const element = lwc.createElement('x-my-app', { is: App });

container.appendChild(element);
1.0.0

3 years ago

10.0.0-alpha4

3 years ago

4.0.1-alpha4

3 years ago

5.1.3-alpha4

3 years ago

4.0.0-alpha4

3 years ago

5.1.2-alpha4

3 years ago

5.1.1-alpha4

3 years ago

5.1.0-alpha4

3 years ago

5.0.0-alpha4

3 years ago

1.0.2

3 years ago