Create one Custom Component
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
import { createElement } from 'lwc';
|
||||||
|
import TestComponent from 'c/testComponent';
|
||||||
|
|
||||||
|
describe('c-test-component', () => {
|
||||||
|
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('TODO: test case generated by CLI command, please fill in test logic', () => {
|
||||||
|
// Arrange
|
||||||
|
const element = createElement('c-test-component', {
|
||||||
|
is: TestComponent
|
||||||
|
});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
document.body.appendChild(element);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
// const div = element.shadowRoot.querySelector('div');
|
||||||
|
expect(1).toBe(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<template>
|
||||||
|
<h1> Hello Word </h1>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { LightningElement } from 'lwc';
|
||||||
|
|
||||||
|
export default class TestComponent extends LightningElement {}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||||
|
<apiVersion>63.0</apiVersion>
|
||||||
|
<isExposed>true</isExposed>
|
||||||
|
<targets>
|
||||||
|
<target>lightning__HomePage</target>
|
||||||
|
</targets>
|
||||||
|
</LightningComponentBundle>
|
||||||
Reference in New Issue
Block a user