@salesforcedevs/arch-components 1.29.0 → 1.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/arch-components",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.1",
|
|
4
4
|
"description": "Architect Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"eventsourcemock": "2.0.0",
|
|
45
45
|
"luxon": "3.4.4"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "71d75798db2bfb52ea29b57f52947190aa0ec092"
|
|
48
48
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { html, render, TemplateResult } from
|
|
2
|
-
import { querySelectorAll, querySelector } from
|
|
3
|
-
|
|
4
|
-
import { createElement, LightningElement, setFeatureFlagForTest } from 'lwc';
|
|
1
|
+
import { html, render, TemplateResult } from "lit-html";
|
|
2
|
+
import { querySelectorAll, querySelector } from "kagekiri";
|
|
3
|
+
import { createElement, LightningElement } from "lwc";
|
|
5
4
|
|
|
6
5
|
export { html, render };
|
|
7
6
|
|
|
@@ -20,7 +19,7 @@ export function $testid(value: string, element: HTMLElement) {
|
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
export function renderIntoBody(template: TemplateResult) {
|
|
23
|
-
const element = document.createElement(
|
|
22
|
+
const element = document.createElement("div");
|
|
24
23
|
document.body.append(element);
|
|
25
24
|
render(template, element);
|
|
26
25
|
return element.children[0] as HTMLElement;
|
|
@@ -39,7 +38,7 @@ export async function renderIntoBodyAndWait(
|
|
|
39
38
|
await new Promise((resolve) => {
|
|
40
39
|
const check = () => {
|
|
41
40
|
const isReady =
|
|
42
|
-
typeof ready ===
|
|
41
|
+
typeof ready === "string"
|
|
43
42
|
? querySelector(ready, element) !== null
|
|
44
43
|
: ready({ querySelector, querySelectorAll });
|
|
45
44
|
if (isReady) {
|
|
@@ -67,7 +66,6 @@ export const createRenderComponent = (
|
|
|
67
66
|
tag: string,
|
|
68
67
|
LWC: new () => LightningElement
|
|
69
68
|
) => {
|
|
70
|
-
setFeatureFlagForTest('ENABLE_LIGHT_DOM_COMPONENTS', true);
|
|
71
69
|
return (properties = {}) => {
|
|
72
70
|
const component = createElement(tag, {
|
|
73
71
|
is: LWC
|
|
@@ -80,17 +78,17 @@ export const createRenderComponent = (
|
|
|
80
78
|
|
|
81
79
|
export const mockSlottedElement = <T extends HTMLElement>(
|
|
82
80
|
element: any,
|
|
83
|
-
elementType =
|
|
81
|
+
elementType = "button",
|
|
84
82
|
slotName?: string
|
|
85
83
|
): { slottedElement: T; slot: HTMLSlotElement } => {
|
|
86
84
|
const slot: HTMLSlotElement = element.shadowRoot.querySelector(
|
|
87
|
-
`slot${slotName ? `[name='${slotName}']` :
|
|
85
|
+
`slot${slotName ? `[name='${slotName}']` : ""}`
|
|
88
86
|
);
|
|
89
87
|
expect(slot).not.toBeNull();
|
|
90
88
|
|
|
91
89
|
const slottedElement = document.createElement(elementType) as T;
|
|
92
90
|
slot.assignedElements = jest.fn(() => [slottedElement]);
|
|
93
|
-
slot.dispatchEvent(new Event(
|
|
91
|
+
slot.dispatchEvent(new Event("slotchange"));
|
|
94
92
|
|
|
95
93
|
return { slottedElement, slot };
|
|
96
94
|
};
|