@open-pioneer/test-utils 0.1.0 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @open-pioneer/test-utils
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - a40f12d: Update build-package tool. TypeScript declaration files should now be available.
8
+ - Updated dependencies [a40f12d]
9
+ - @open-pioneer/chakra-integration@0.1.2
10
+ - @open-pioneer/runtime@0.1.2
11
+
12
+ ## 0.1.1
13
+
14
+ ### Patch Changes
15
+
16
+ - e1c7295: Compiled with build-package 0.5.2
17
+ - Updated dependencies [e1c7295]
18
+ - @open-pioneer/chakra-integration@0.1.1
19
+ - @open-pioneer/runtime@0.1.1
20
+
3
21
  ## 0.1.0
4
22
 
5
23
  ### Minor Changes
package/package.json CHANGED
@@ -1,26 +1,29 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/test-utils",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "dependencies": {
6
6
  "@testing-library/react": "^14.0.0",
7
7
  "react": "^18.2.0",
8
8
  "react-dom": "^18.2.0",
9
9
  "@testing-library/dom": "^9.3.0",
10
10
  "@formatjs/intl": "^2.7.2",
11
- "@open-pioneer/runtime": "^0.1.0",
12
- "@open-pioneer/chakra-integration": "^0.1.0"
11
+ "@open-pioneer/runtime": "^0.1.2",
12
+ "@open-pioneer/chakra-integration": "^0.1.2"
13
13
  },
14
14
  "exports": {
15
15
  "./package.json": "./package.json",
16
16
  "./web-components": {
17
- "import": "./web-components.js"
17
+ "import": "./web-components.js",
18
+ "types": "./web-components.d.ts"
18
19
  },
19
20
  "./react": {
20
- "import": "./react.js"
21
+ "import": "./react.js",
22
+ "types": "./react.d.ts"
21
23
  },
22
24
  "./services": {
23
- "import": "./services.js"
25
+ "import": "./services.js",
26
+ "types": "./services.d.ts"
24
27
  }
25
28
  },
26
29
  "openPioneerFramework": {
package/react.d.ts ADDED
@@ -0,0 +1,45 @@
1
+ import { Service } from "@open-pioneer/runtime";
2
+ import { FC, ReactNode } from "react";
3
+ export type AnyService = Service<any>;
4
+ export interface PackageContextProviderProps {
5
+ /** Interface implementations, keyed by interface name. */
6
+ services?: {
7
+ [interfaceName: string]: AnyService;
8
+ };
9
+ /** Interface implementations, keyed by interface name and then by qualifier. */
10
+ qualifiedServices?: {
11
+ [interfaceName: string]: {
12
+ [qualifier: string]: AnyService;
13
+ };
14
+ };
15
+ /** Package properties (keyed by package name). */
16
+ properties?: {
17
+ [packageName: string]: Record<string, unknown>;
18
+ };
19
+ /**
20
+ * The locale for i18n messages and formatting.
21
+ *
22
+ * @default "en"
23
+ */
24
+ locale?: string;
25
+ /**
26
+ * I18n messages for packages
27
+ */
28
+ messages?: {
29
+ /**
30
+ * I18n messages as (messageId, message) entries.
31
+ *
32
+ * @default {}
33
+ */
34
+ [packageName: string]: Record<string, string>;
35
+ };
36
+ /** Children to render */
37
+ children?: ReactNode;
38
+ }
39
+ /**
40
+ * Injects services and properties into the component tree.
41
+ * React components using pioneer hooks like `useService` and `useProperties`
42
+ * will receive the mocked properties here instead.
43
+ * Currently also wrapped with the CustomChakraProvider to support chakra-ui elements
44
+ */
45
+ export declare const PackageContextProvider: FC<PackageContextProviderProps>;
package/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sources":["open-pioneer://external-pioneer-packages/@open-pioneer/test-utils/react.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: con terra GmbH and contributors\n// SPDX-License-Identifier: Apache-2.0\nimport { createIntl, createIntlCache, IntlShape } from \"@formatjs/intl\";\nimport { CustomChakraProvider } from \"@open-pioneer/chakra-integration\";\nimport { Service } from \"@open-pioneer/runtime\";\nimport {\n PackageContext as InternalPackageContext,\n PackageContextMethods\n} from \"@open-pioneer/runtime/react-integration\";\nimport { FC, ReactNode, useMemo } from \"react\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyService = Service<any>;\n\nexport interface PackageContextProviderProps {\n /** Interface implementations, keyed by interface name. */\n services?: {\n [interfaceName: string]: AnyService;\n };\n\n /** Interface implementations, keyed by interface name and then by qualifier. */\n qualifiedServices?: {\n [interfaceName: string]: {\n [qualifier: string]: AnyService;\n };\n };\n\n /** Package properties (keyed by package name). */\n properties?: {\n [packageName: string]: Record<string, unknown>;\n };\n\n /**\n * The locale for i18n messages and formatting.\n *\n * @default \"en\"\n */\n locale?: string;\n\n /**\n * I18n messages for packages\n */\n messages?: {\n /**\n * I18n messages as (messageId, message) entries.\n *\n * @default {}\n */\n [packageName: string]: Record<string, string>;\n };\n\n /** Children to render */\n children?: ReactNode;\n}\n\n/**\n * Injects services and properties into the component tree.\n * React components using pioneer hooks like `useService` and `useProperties`\n * will receive the mocked properties here instead.\n * Currently also wrapped with the CustomChakraProvider to support chakra-ui elements\n */\nexport const PackageContextProvider: FC<PackageContextProviderProps> = (props) => {\n const { children, ...rest } = props;\n const contextMethods = useMemo(() => createPackageContextMethods(rest), [rest]);\n return (\n <CustomChakraProvider container={document.body}>\n <InternalPackageContext.Provider value={contextMethods}>\n {children}\n </InternalPackageContext.Provider>\n </CustomChakraProvider>\n );\n};\n\nfunction createPackageContextMethods(\n options: Omit<PackageContextProviderProps, \"children\">\n): PackageContextMethods {\n const services = options?.services ?? {};\n const qualifiedServices = options?.qualifiedServices ?? {};\n const properties = options?.properties ?? {};\n const locale = options?.locale ?? \"en\";\n const messages = options?.messages ?? {};\n const cachedIntl: Record<string, IntlShape> = {};\n return {\n getService(packageName, interfaceName, options) {\n if (!options.qualifier) {\n const service = services[interfaceName];\n if (service) {\n return service;\n }\n const qualified = qualifiedServices[interfaceName];\n if (qualified) {\n for (const value of Object.values(qualified)) {\n return value; // Return any implementation\n }\n }\n throw new Error(\n `Interface name not bound for testing: '${interfaceName}'. Update the configuration of PackageContextProvider.`\n );\n }\n\n const qualifiedService = qualifiedServices[interfaceName]?.[options.qualifier];\n if (!qualifiedService) {\n throw new Error(\n `Interface name not bound for testing: '${interfaceName}' (qualifier '${options.qualifier}'). Update the configuration of PackageContextProvider.`\n );\n }\n return qualifiedService;\n },\n getServices(packageName, interfaceName) {\n const unqualified = services[interfaceName];\n const results = Object.values(qualifiedServices[interfaceName] ?? {});\n if (unqualified) {\n results.push(unqualified);\n }\n return results;\n },\n getProperties(packageName) {\n const packageProperties = properties[packageName];\n if (!packageProperties) {\n throw new Error(\n `No properties for package '${packageName}' bound for testing. Update the configuration of PackageContextProvider.`\n );\n }\n return packageProperties;\n },\n getIntl(packageName) {\n const initIntl = () => {\n const packageMessages = messages[packageName];\n const cache = createIntlCache();\n return createIntl(\n {\n locale,\n messages: packageMessages\n },\n cache\n );\n };\n return (cachedIntl[packageName] ??= initIntl());\n }\n };\n}\n"],"names":["InternalPackageContext","options"],"mappings":";;;;;;AA6Da,MAAA,sBAAA,GAA0D,CAAC,KAAU,KAAA;AAC9E,EAAA,MAAM,EAAE,QAAA,EAAU,GAAG,IAAA,EAAS,GAAA,KAAA,CAAA;AAC9B,EAAM,MAAA,cAAA,GAAiB,QAAQ,MAAM,2BAAA,CAA4B,IAAI,CAAG,EAAA,CAAC,IAAI,CAAC,CAAA,CAAA;AAC9E,EAAA,uBACK,GAAA,CAAA,oBAAA,EAAA,EAAqB,SAAW,EAAA,QAAA,CAAS,IACtC,EAAA,QAAA,kBAAA,GAAA,CAACA,cAAuB,CAAA,QAAA,EAAvB,EAAgC,KAAA,EAAO,cACnC,EAAA,QAAA,EACL,CACJ,EAAA,CAAA,CAAA;AAER,EAAA;AAEA,SAAS,4BACL,OACqB,EAAA;AACrB,EAAM,MAAA,QAAA,GAAW,OAAS,EAAA,QAAA,IAAY,EAAC,CAAA;AACvC,EAAM,MAAA,iBAAA,GAAoB,OAAS,EAAA,iBAAA,IAAqB,EAAC,CAAA;AACzD,EAAM,MAAA,UAAA,GAAa,OAAS,EAAA,UAAA,IAAc,EAAC,CAAA;AAC3C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A,CAAA;AACpE,MAAA,IAAI,WAAa,EAAA;AACb,QAAA,OAAA,CAAQ,KAAK,WAAW,CAAA,CAAA;AAAA,OAC5B;AACA,MAAO,OAAA,OAAA,CAAA;AAAA,KACX;AAAA,IACA,cAAc,WAAa,EAAA;AACvB,MAAM,MAAA,iBAAA,GAAoB,WAAW,WAAW,CAAA,CAAA;AAChD,MAAA,IAAI,CAAC,iBAAmB,EAAA;AACpB,QAAA,MAAM,IAAI,KAAA;AAAA,UACN,CAA8B,2BAAA,EAAA,WAAA,CAAA,wEAAA,CAAA;AAAA,SAClC,CAAA;AAAA,OACJ;AACA,MAAO,OAAA,iBAAA,CAAA;AAAA,KACX;AAAA,IACA,QAAQ,WAAa,EAAA;AACjB,MAAA,MAAM,WAAW,MAAM;AACnB,QAAM,MAAA,eAAA,GAAkB,SAAS,WAAW,CAAA,CAAA;AAC5C,QAAA,MAAM,QAAQ,eAAgB,EAAA,CAAA;AAC9B,QAAO,OAAA,UAAA;AAAA,UACH;AAAA,YACI,MAAA;AAAA,YACA,QAAU,EAAA,eAAA;AAAA,WACd;AAAA,UACA,KAAA;AAAA,SACJ,CAAA;AAAA,OACJ,CAAA;AACA,MAAQ,OAAA,UAAA,CAAW,WAAW,CAAA,KAAM,QAAS,EAAA,CAAA;AAAA,KACjD;AAAA,GACJ,CAAA;AACJ;;;;"}
1
+ {"version":3,"file":"react.js","sources":["react.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: con terra GmbH and contributors\n// SPDX-License-Identifier: Apache-2.0\nimport { createIntl, createIntlCache, IntlShape } from \"@formatjs/intl\";\nimport { CustomChakraProvider } from \"@open-pioneer/chakra-integration\";\nimport { Service } from \"@open-pioneer/runtime\";\nimport {\n PackageContext as InternalPackageContext,\n PackageContextMethods\n} from \"@open-pioneer/runtime/react-integration\";\nimport { FC, ReactNode, useMemo } from \"react\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyService = Service<any>;\n\nexport interface PackageContextProviderProps {\n /** Interface implementations, keyed by interface name. */\n services?: {\n [interfaceName: string]: AnyService;\n };\n\n /** Interface implementations, keyed by interface name and then by qualifier. */\n qualifiedServices?: {\n [interfaceName: string]: {\n [qualifier: string]: AnyService;\n };\n };\n\n /** Package properties (keyed by package name). */\n properties?: {\n [packageName: string]: Record<string, unknown>;\n };\n\n /**\n * The locale for i18n messages and formatting.\n *\n * @default \"en\"\n */\n locale?: string;\n\n /**\n * I18n messages for packages\n */\n messages?: {\n /**\n * I18n messages as (messageId, message) entries.\n *\n * @default {}\n */\n [packageName: string]: Record<string, string>;\n };\n\n /** Children to render */\n children?: ReactNode;\n}\n\n/**\n * Injects services and properties into the component tree.\n * React components using pioneer hooks like `useService` and `useProperties`\n * will receive the mocked properties here instead.\n * Currently also wrapped with the CustomChakraProvider to support chakra-ui elements\n */\nexport const PackageContextProvider: FC<PackageContextProviderProps> = (props) => {\n const { children, ...rest } = props;\n const contextMethods = useMemo(() => createPackageContextMethods(rest), [rest]);\n return (\n <CustomChakraProvider container={document.body}>\n <InternalPackageContext.Provider value={contextMethods}>\n {children}\n </InternalPackageContext.Provider>\n </CustomChakraProvider>\n );\n};\n\nfunction createPackageContextMethods(\n options: Omit<PackageContextProviderProps, \"children\">\n): PackageContextMethods {\n const services = options?.services ?? {};\n const qualifiedServices = options?.qualifiedServices ?? {};\n const properties = options?.properties ?? {};\n const locale = options?.locale ?? \"en\";\n const messages = options?.messages ?? {};\n const cachedIntl: Record<string, IntlShape> = {};\n return {\n getService(packageName, interfaceName, options) {\n if (!options.qualifier) {\n const service = services[interfaceName];\n if (service) {\n return service;\n }\n const qualified = qualifiedServices[interfaceName];\n if (qualified) {\n for (const value of Object.values(qualified)) {\n return value; // Return any implementation\n }\n }\n throw new Error(\n `Interface name not bound for testing: '${interfaceName}'. Update the configuration of PackageContextProvider.`\n );\n }\n\n const qualifiedService = qualifiedServices[interfaceName]?.[options.qualifier];\n if (!qualifiedService) {\n throw new Error(\n `Interface name not bound for testing: '${interfaceName}' (qualifier '${options.qualifier}'). Update the configuration of PackageContextProvider.`\n );\n }\n return qualifiedService;\n },\n getServices(packageName, interfaceName) {\n const unqualified = services[interfaceName];\n const results = Object.values(qualifiedServices[interfaceName] ?? {});\n if (unqualified) {\n results.push(unqualified);\n }\n return results;\n },\n getProperties(packageName) {\n const packageProperties = properties[packageName];\n if (!packageProperties) {\n throw new Error(\n `No properties for package '${packageName}' bound for testing. Update the configuration of PackageContextProvider.`\n );\n }\n return packageProperties;\n },\n getIntl(packageName) {\n const initIntl = () => {\n const packageMessages = messages[packageName];\n const cache = createIntlCache();\n return createIntl(\n {\n locale,\n messages: packageMessages\n },\n cache\n );\n };\n return (cachedIntl[packageName] ??= initIntl());\n }\n };\n}\n"],"names":["InternalPackageContext","options"],"mappings":";;;;;;AA6Da,MAAA,sBAAA,GAA0D,CAAC,KAAU,KAAA;AAC9E,EAAA,MAAM,EAAE,QAAA,EAAU,GAAG,IAAA,EAAS,GAAA,KAAA,CAAA;AAC9B,EAAM,MAAA,cAAA,GAAiB,QAAQ,MAAM,2BAAA,CAA4B,IAAI,CAAG,EAAA,CAAC,IAAI,CAAC,CAAA,CAAA;AAC9E,EAAA,uBACK,GAAA,CAAA,oBAAA,EAAA,EAAqB,SAAW,EAAA,QAAA,CAAS,IACtC,EAAA,QAAA,kBAAA,GAAA,CAACA,cAAuB,CAAA,QAAA,EAAvB,EAAgC,KAAA,EAAO,cACnC,EAAA,QAAA,EACL,CACJ,EAAA,CAAA,CAAA;AAER,EAAA;AAEA,SAAS,4BACL,OACqB,EAAA;AACrB,EAAM,MAAA,QAAA,GAAW,OAAS,EAAA,QAAA,IAAY,EAAC,CAAA;AACvC,EAAM,MAAA,iBAAA,GAAoB,OAAS,EAAA,iBAAA,IAAqB,EAAC,CAAA;AACzD,EAAM,MAAA,UAAA,GAAa,OAAS,EAAA,UAAA,IAAc,EAAC,CAAA;AAC3C,EAAM,MAAA,MAAA,GAAS,SAAS,MAAU,IAAA,IAAA,CAAA;AAClC,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,KAAK,WAAW,CAAA,CAAA;AAAA,OAC5B;AACA,MAAO,OAAA,OAAA,CAAA;AAAA,KACX;AAAA,IACA,cAAc,WAAa,EAAA;AACvB,MAAM,MAAA,iBAAA,GAAoB,WAAW,WAAW,CAAA,CAAA;AAChD,MAAA,IAAI,CAAC,iBAAmB,EAAA;AACpB,QAAA,MAAM,IAAI,KAAA;AAAA,UACN,CAA8B,2BAAA,EAAA,WAAA,CAAA,wEAAA,CAAA;AAAA,SAClC,CAAA;AAAA,OACJ;AACA,MAAO,OAAA,iBAAA,CAAA;AAAA,KACX;AAAA,IACA,QAAQ,WAAa,EAAA;AACjB,MAAA,MAAM,WAAW,MAAM;AACnB,QAAM,MAAA,eAAA,GAAkB,SAAS,WAAW,CAAA,CAAA;AAC5C,QAAA,MAAM,QAAQ,eAAgB,EAAA,CAAA;AAC9B,QAAO,OAAA,UAAA;AAAA,UACH;AAAA,YACI,MAAA;AAAA,YACA,QAAU,EAAA,eAAA;AAAA,WACd;AAAA,UACA,KAAA;AAAA,SACJ,CAAA;AAAA,OACJ,CAAA;AACA,MAAQ,OAAA,UAAA,CAAW,WAAW,CAAA,KAAM,QAAS,EAAA,CAAA;AAAA,KACjD;AAAA,GACJ,CAAA;AACJ;;;;"}
package/services.d.ts ADDED
@@ -0,0 +1,61 @@
1
+ import { Service, ServiceConstructor } from "@open-pioneer/runtime";
2
+ /**
3
+ * Options for the {@link createService} function.
4
+ */
5
+ export interface CreateServiceOptions<References> {
6
+ /**
7
+ * References provided to the service constructor.
8
+ *
9
+ * @default {}
10
+ */
11
+ references?: PartialServiceReferences<References>;
12
+ /**
13
+ * Properties provided to the service constructor.
14
+ *
15
+ * @default {}
16
+ */
17
+ properties?: Record<string, unknown>;
18
+ /**
19
+ * The locale for i18n messages and formatting.
20
+ *
21
+ * @default "en"
22
+ */
23
+ locale?: string;
24
+ /**
25
+ * The locale for embedded default messages.
26
+ *
27
+ * See also https://formatjs.io/docs/intl#message-descriptor
28
+ *
29
+ * @default "en"
30
+ */
31
+ defaultMessageLocale?: string;
32
+ /**
33
+ * I18n messages as (messageId, message) entries.
34
+ *
35
+ * @default {}
36
+ */
37
+ messages?: Record<string, string>;
38
+ }
39
+ type PartialServiceReferences<References> = {
40
+ [referenceName in keyof References]?: References[referenceName] extends any[] ? Partial<References[referenceName][number]>[] : Partial<References[referenceName]>;
41
+ };
42
+ /**
43
+ * Creates a new service instance of `clazz`.
44
+ *
45
+ * The options passed into the constructor of `clazz` are taking from the `options` parameter.
46
+ *
47
+ * This function allows the user to define mock- or test objects as service references.
48
+ *
49
+ * Most type-checking features are disabled for convenience, but by default this function's types
50
+ * enforce that a value provided for a reference must match the partial interface of the actually required type.
51
+ *
52
+ * For example, if a service depends on `{ ctx: ApplicationContext }`, this function ensures
53
+ * that the test value for `ctx` implements `Partial<ApplicationContext>`.
54
+ * This can of course be disabled by casting the value explicitly.
55
+ *
56
+ * @param clazz a service class
57
+ * @param options options passed to the service constructor
58
+ * @returns a new instance of the given service class
59
+ */
60
+ export declare function createService<References extends {}, Interface extends {}>(clazz: ServiceConstructor<References, Interface>, options?: CreateServiceOptions<References>): Promise<Service<Interface>>;
61
+ export {};
package/services.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"services.js","sources":["open-pioneer://external-pioneer-packages/@open-pioneer/test-utils/services.ts"],"sourcesContent":["// SPDX-FileCopyrightText: con terra GmbH and contributors\n// SPDX-License-Identifier: Apache-2.0\nimport { ReferenceMeta, Service, ServiceConstructor } from \"@open-pioneer/runtime\";\nimport { createIntl, createIntlCache } from \"@formatjs/intl\";\n\n/**\n * Options for the {@link createService} function.\n */\nexport interface CreateServiceOptions<References> {\n /**\n * References provided to the service constructor.\n *\n * @default {}\n */\n references?: PartialServiceReferences<References>;\n\n /**\n * Properties provided to the service constructor.\n *\n * @default {}\n */\n properties?: Record<string, unknown>;\n\n /**\n * The locale for i18n messages and formatting.\n *\n * @default \"en\"\n */\n locale?: string;\n\n /**\n * The locale for embedded default messages.\n *\n * See also https://formatjs.io/docs/intl#message-descriptor\n *\n * @default \"en\"\n */\n defaultMessageLocale?: string;\n\n /**\n * I18n messages as (messageId, message) entries.\n *\n * @default {}\n */\n messages?: Record<string, string>;\n}\n\ntype PartialServiceReferences<References> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [referenceName in keyof References]?: References[referenceName] extends any[]\n ? Partial<References[referenceName][number]>[]\n : Partial<References[referenceName]>;\n};\n\n/**\n * Creates a new service instance of `clazz`.\n *\n * The options passed into the constructor of `clazz` are taking from the `options` parameter.\n *\n * This function allows the user to define mock- or test objects as service references.\n *\n * Most type-checking features are disabled for convenience, but by default this function's types\n * enforce that a value provided for a reference must match the partial interface of the actually required type.\n *\n * For example, if a service depends on `{ ctx: ApplicationContext }`, this function ensures\n * that the test value for `ctx` implements `Partial<ApplicationContext>`.\n * This can of course be disabled by casting the value explicitly.\n *\n * @param clazz a service class\n * @param options options passed to the service constructor\n * @returns a new instance of the given service class\n */\nexport async function createService<References extends {}, Interface extends {}>(\n clazz: ServiceConstructor<References, Interface>,\n options?: CreateServiceOptions<References>\n): Promise<Service<Interface>> {\n const references = options?.references ?? {};\n const referencesMeta = Object.fromEntries(\n Object.entries(references).map(([referenceName, reference]) => [\n referenceName,\n referenceMeta(referenceName, reference)\n ])\n );\n\n const locale = options?.locale ?? \"en\";\n const defaultMessageLocale = options?.defaultMessageLocale ?? \"en\";\n const messages = options?.messages ?? {};\n const cache = createIntlCache();\n const intl = createIntl(\n {\n locale,\n defaultLocale: defaultMessageLocale,\n messages\n },\n cache\n );\n\n return new clazz({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n references: references as any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n referencesMeta: referencesMeta as any,\n properties: options?.properties ?? {},\n intl\n });\n}\n\nfunction referenceMeta(referenceName: string, reference: unknown): ReferenceMeta | ReferenceMeta[] {\n if (Array.isArray(reference)) {\n return reference.map<ReferenceMeta>((_, index) => ({\n serviceId: `test-utils::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,CAAA,CAAA,EAAA,KAAA,CAAA,CAAA;AAAA,KAC7C,CAAA,CAAA,CAAA;AAAA,GACN;AACA,EAAO,OAAA;AAAA,IACH,WAAW,CAAe,YAAA,EAAA,aAAA,CAAA,CAAA;AAAA,GAC9B,CAAA;AACJ;;;;"}
1
+ {"version":3,"file":"services.js","sources":["services.ts"],"sourcesContent":["// SPDX-FileCopyrightText: con terra GmbH and contributors\n// SPDX-License-Identifier: Apache-2.0\nimport { ReferenceMeta, Service, ServiceConstructor } from \"@open-pioneer/runtime\";\nimport { createIntl, createIntlCache } from \"@formatjs/intl\";\n\n/**\n * Options for the {@link createService} function.\n */\nexport interface CreateServiceOptions<References> {\n /**\n * References provided to the service constructor.\n *\n * @default {}\n */\n references?: PartialServiceReferences<References>;\n\n /**\n * Properties provided to the service constructor.\n *\n * @default {}\n */\n properties?: Record<string, unknown>;\n\n /**\n * The locale for i18n messages and formatting.\n *\n * @default \"en\"\n */\n locale?: string;\n\n /**\n * The locale for embedded default messages.\n *\n * See also https://formatjs.io/docs/intl#message-descriptor\n *\n * @default \"en\"\n */\n defaultMessageLocale?: string;\n\n /**\n * I18n messages as (messageId, message) entries.\n *\n * @default {}\n */\n messages?: Record<string, string>;\n}\n\ntype PartialServiceReferences<References> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [referenceName in keyof References]?: References[referenceName] extends any[]\n ? Partial<References[referenceName][number]>[]\n : Partial<References[referenceName]>;\n};\n\n/**\n * Creates a new service instance of `clazz`.\n *\n * The options passed into the constructor of `clazz` are taking from the `options` parameter.\n *\n * This function allows the user to define mock- or test objects as service references.\n *\n * Most type-checking features are disabled for convenience, but by default this function's types\n * enforce that a value provided for a reference must match the partial interface of the actually required type.\n *\n * For example, if a service depends on `{ ctx: ApplicationContext }`, this function ensures\n * that the test value for `ctx` implements `Partial<ApplicationContext>`.\n * This can of course be disabled by casting the value explicitly.\n *\n * @param clazz a service class\n * @param options options passed to the service constructor\n * @returns a new instance of the given service class\n */\nexport async function createService<References extends {}, Interface extends {}>(\n clazz: ServiceConstructor<References, Interface>,\n options?: CreateServiceOptions<References>\n): Promise<Service<Interface>> {\n const references = options?.references ?? {};\n const referencesMeta = Object.fromEntries(\n Object.entries(references).map(([referenceName, reference]) => [\n referenceName,\n referenceMeta(referenceName, reference)\n ])\n );\n\n const locale = options?.locale ?? \"en\";\n const defaultMessageLocale = options?.defaultMessageLocale ?? \"en\";\n const messages = options?.messages ?? {};\n const cache = createIntlCache();\n const intl = createIntl(\n {\n locale,\n defaultLocale: defaultMessageLocale,\n messages\n },\n cache\n );\n\n return new clazz({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n references: references as any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n referencesMeta: referencesMeta as any,\n properties: options?.properties ?? {},\n intl\n });\n}\n\nfunction referenceMeta(referenceName: string, reference: unknown): ReferenceMeta | ReferenceMeta[] {\n if (Array.isArray(reference)) {\n return reference.map<ReferenceMeta>((_, index) => ({\n serviceId: `test-utils::${referenceName}-${index}`\n }));\n }\n return {\n serviceId: `test-utils::${referenceName}`\n };\n}\n"],"names":[],"mappings":";;AAwEsB,eAAA,aAAA,CAClB,OACA,OAC2B,EAAA;AAC3B,EAAM,MAAA,UAAA,GAAa,OAAS,EAAA,UAAA,IAAc,EAAC,CAAA;AAC3C,EAAA,MAAM,iBAAiB,MAAO,CAAA,WAAA;AAAA,IAC1B,MAAA,CAAO,QAAQ,UAAU,CAAA,CAAE,IAAI,CAAC,CAAC,aAAe,EAAA,SAAS,CAAM,KAAA;AAAA,MAC3D,aAAA;AAAA,MACA,aAAA,CAAc,eAAe,SAAS,CAAA;AAAA,KACzC,CAAA;AAAA,GACL,CAAA;AAEA,EAAM,MAAA,MAAA,GAAS,SAAS,MAAU,IAAA,IAAA,CAAA;AAClC,EAAM,MAAA,oBAAA,GAAuB,SAAS,oBAAwB,IAAA,IAAA,CAAA;AAC9D,EAAM,MAAA,QAAA,GAAW,OAAS,EAAA,QAAA,IAAY,EAAC,CAAA;AACvC,EAAA,MAAM,QAAQ,eAAgB,EAAA,CAAA;AAC9B,EAAA,MAAM,IAAO,GAAA,UAAA;AAAA,IACT;AAAA,MACI,MAAA;AAAA,MACA,aAAe,EAAA,oBAAA;AAAA,MACf,QAAA;AAAA,KACJ;AAAA,IACA,KAAA;AAAA,GACJ,CAAA;AAEA,EAAA,OAAO,IAAI,KAAM,CAAA;AAAA;AAAA,IAEb,UAAA;AAAA;AAAA,IAEA,cAAA;AAAA,IACA,UAAA,EAAY,OAAS,EAAA,UAAA,IAAc,EAAC;AAAA,IACpC,IAAA;AAAA,GACH,CAAA,CAAA;AACL,CAAA;AAEA,SAAS,aAAA,CAAc,eAAuB,SAAqD,EAAA;AAC/F,EAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,SAAS,CAAG,EAAA;AAC1B,IAAA,OAAO,SAAU,CAAA,GAAA,CAAmB,CAAC,CAAA,EAAG,KAAW,MAAA;AAAA,MAC/C,SAAA,EAAW,eAAe,aAAiB,CAAA,CAAA,EAAA,KAAA,CAAA,CAAA;AAAA,KAC7C,CAAA,CAAA,CAAA;AAAA,GACN;AACA,EAAO,OAAA;AAAA,IACH,WAAW,CAAe,YAAA,EAAA,aAAA,CAAA,CAAA;AAAA,GAC9B,CAAA;AACJ;;;;"}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Renders the given component into the DOM and returns the new node.
3
+ */
4
+ export declare function renderComponent(component: CustomElementConstructor | string, options?: {
5
+ container?: HTMLElement;
6
+ attributes?: Record<string, string>;
7
+ }): Promise<{
8
+ node: HTMLElement;
9
+ }>;
10
+ /**
11
+ * Renders the given component into the DOM (via {@link renderComponent}) and works on its shadow root.
12
+ * In order to use this function, the shadow root should be attached as `open` from inside the component class.
13
+ *
14
+ * After the shadow root has been accessed, the function searches (and waits) for an inner root container (by default `.pioneer-root`)
15
+ * where all other searches should be executed.
16
+ *
17
+ * Returns the shadow root, the inner container, and a bound queries object that automatically searches in the inner container
18
+ * instead of the whole document.
19
+ */
20
+ export declare function renderComponentShadowDOM(component: CustomElementConstructor | string, options?: {
21
+ container?: HTMLElement;
22
+ attributes?: Record<string, string>;
23
+ innerContainerSelector?: string;
24
+ }): Promise<{
25
+ node: HTMLElement;
26
+ shadowRoot: ShadowRoot;
27
+ innerContainer: HTMLElement;
28
+ queries: {
29
+ getByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T;
30
+ getAllByLabelText<T_1 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_1[];
31
+ queryByLabelText<T_2 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_2 | null;
32
+ queryAllByLabelText<T_3 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_3[];
33
+ findByLabelText<T_4 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_4>;
34
+ findAllByLabelText<T_5 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_5[]>;
35
+ getByPlaceholderText<T_6 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_6;
36
+ getAllByPlaceholderText<T_7 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_7[];
37
+ queryByPlaceholderText<T_8 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_8 | null;
38
+ queryAllByPlaceholderText<T_9 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_9[];
39
+ findByPlaceholderText<T_10 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_10>;
40
+ findAllByPlaceholderText<T_11 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_11[]>;
41
+ getByText<T_12 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_12;
42
+ getAllByText<T_13 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_13[];
43
+ queryByText<T_14 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_14 | null;
44
+ queryAllByText<T_15 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_15[];
45
+ findByText<T_16 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_16>;
46
+ findAllByText<T_17 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_17[]>;
47
+ getByAltText<T_18 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_18;
48
+ getAllByAltText<T_19 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_19[];
49
+ queryByAltText<T_20 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_20 | null;
50
+ queryAllByAltText<T_21 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_21[];
51
+ findByAltText<T_22 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_22>;
52
+ findAllByAltText<T_23 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_23[]>;
53
+ getByTitle<T_24 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_24;
54
+ getAllByTitle<T_25 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_25[];
55
+ queryByTitle<T_26 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_26 | null;
56
+ queryAllByTitle<T_27 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_27[];
57
+ findByTitle<T_28 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_28>;
58
+ findAllByTitle<T_29 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_29[]>;
59
+ getByDisplayValue<T_30 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_30;
60
+ getAllByDisplayValue<T_31 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_31[];
61
+ queryByDisplayValue<T_32 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_32 | null;
62
+ queryAllByDisplayValue<T_33 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_33[];
63
+ findByDisplayValue<T_34 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_34>;
64
+ findAllByDisplayValue<T_35 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_35[]>;
65
+ getByRole<T_36 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined): T_36;
66
+ getAllByRole<T_37 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined): T_37[];
67
+ queryByRole<T_38 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined): T_38 | null;
68
+ queryAllByRole<T_39 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined): T_39[];
69
+ findByRole<T_40 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_40>;
70
+ findAllByRole<T_41 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_41[]>;
71
+ getByTestId<T_42 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_42;
72
+ getAllByTestId<T_43 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_43[];
73
+ queryByTestId<T_44 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_44 | null;
74
+ queryAllByTestId<T_45 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_45[];
75
+ findByTestId<T_46 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_46>;
76
+ findAllByTestId<T_47 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_47[]>;
77
+ } & {
78
+ getByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement;
79
+ getAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
80
+ queryByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement | null;
81
+ queryAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
82
+ findByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
83
+ findAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
84
+ getByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
85
+ getAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
86
+ queryByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
87
+ queryAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
88
+ findByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
89
+ findAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
90
+ getByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement;
91
+ getAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
92
+ queryByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement | null;
93
+ queryAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
94
+ findByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
95
+ findAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
96
+ getByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
97
+ getAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
98
+ queryByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
99
+ queryAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
100
+ findByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
101
+ findAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
102
+ getByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
103
+ getAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
104
+ queryByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
105
+ queryAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
106
+ findByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
107
+ findAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
108
+ getByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
109
+ getAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
110
+ queryByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
111
+ queryAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
112
+ findByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
113
+ findAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
114
+ getByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement;
115
+ getAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement[];
116
+ queryByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement | null;
117
+ queryAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement[];
118
+ findByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
119
+ findAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
120
+ getByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
121
+ getAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
122
+ queryByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
123
+ queryAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
124
+ findByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
125
+ findAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
126
+ };
127
+ }>;
128
+ /**
129
+ * Defines the given component and returns the unique tag name.
130
+ * This helper is necessary because tag names must not collide in the global elements registry (and
131
+ * un-registration is not possible).
132
+ */
133
+ export declare function defineComponent(component: CustomElementConstructor, options?: {
134
+ nameHint?: string;
135
+ }): string;
@@ -1 +1 @@
1
- {"version":3,"file":"web-components.js","sources":["open-pioneer://external-pioneer-packages/@open-pioneer/test-utils/web-components.ts"],"sourcesContent":["// SPDX-FileCopyrightText: con terra GmbH and contributors\n// SPDX-License-Identifier: Apache-2.0\nimport { waitFor, within } from \"@testing-library/dom\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst GLOBAL = global as any;\n\nfunction nextId(): number {\n GLOBAL[\"__WEB_COMPONENT_COUNT__\"] ??= 0;\n const id = (GLOBAL[\"__WEB_COMPONENT_COUNT__\"] += 1);\n return id;\n}\n\n/**\n * Renders the given component into the DOM and returns the new node.\n */\nexport async function renderComponent(\n component: CustomElementConstructor | string,\n options?: {\n container?: HTMLElement;\n attributes?: Record<string, string>;\n }\n) {\n const tag = typeof component === \"string\" ? component : defineComponent(component);\n const container = options?.container ?? document.body;\n const node = container.ownerDocument.createElement(tag);\n for (const [key, value] of Object.entries(options?.attributes ?? {})) {\n node.setAttribute(key, value);\n }\n container.innerHTML = \"\";\n container.appendChild(node);\n return {\n node\n };\n}\n\n/**\n * Renders the given component into the DOM (via {@link renderComponent}) and works on its shadow root.\n * In order to use this function, the shadow root should be attached as `open` from inside the component class.\n *\n * After the shadow root has been accessed, the function searches (and waits) for an inner root container (by default `.pioneer-root`)\n * where all other searches should be executed.\n *\n * Returns the shadow root, the inner container, and a bound queries object that automatically searches in the inner container\n * instead of the whole document.\n */\nexport async function renderComponentShadowDOM(\n component: CustomElementConstructor | string,\n options?: {\n container?: HTMLElement;\n attributes?: Record<string, string>;\n innerContainerSelector?: string;\n }\n) {\n const { node } = await renderComponent(component, options);\n const selector = options?.innerContainerSelector ?? \".pioneer-root\";\n const { shadowRoot, innerContainer } = await waitFor(() => {\n const shadowRoot = node.shadowRoot;\n if (!shadowRoot) {\n throw new Error(\"Shadow root not attached.\");\n }\n const innerContainer = shadowRoot.querySelector<HTMLElement>(selector);\n if (!innerContainer) {\n throw new Error(\"Inner container not ready.\");\n }\n return { shadowRoot, innerContainer };\n });\n\n const queries = within(innerContainer);\n return {\n node,\n shadowRoot,\n innerContainer,\n queries\n };\n}\n\n/**\n * Defines the given component and returns the unique tag name.\n * This helper is necessary because tag names must not collide in the global elements registry (and\n * un-registration is not possible).\n */\nexport function defineComponent(\n component: CustomElementConstructor,\n options?: {\n nameHint?: string;\n }\n) {\n const nameHint = options?.nameHint ?? \"test-component\";\n const tag = `${nameHint}-${nextId()}`;\n customElements.define(tag, component);\n return tag;\n}\n"],"names":["shadowRoot","innerContainer"],"mappings":";;AAKA,MAAM,MAAS,GAAA,MAAA,CAAA;AAEf,SAAS,MAAiB,GAAA;AACtB,EAAA,MA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,MAAAA,eAAAA,GAAiBD,WAAW,CAAA,aAAA,CAA2B,QAAQ,CAAA,CAAA;AACrE,IAAA,IAAI,CAACC,eAAgB,EAAA;AACjB,MAAM,MAAA,IAAI,MAAM,4BAA4B,CAAA,CAAA;AAAA,KAChD;AACA,IAAA,OAAO,EAAE,UAAA,EAAAD,WAAY,EAAA,cAAA,EAAAC,eAAe,EAAA,CAAA;AAAA,GACvC,CAAA,CAAA;AAED,EAAM,MAAA,OAAA,GAAU,OAAO,cAAc,CAAA,CAAA;AACrC,EAAO,OAAA;AAAA,IACH,IAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA;AAAA,IACA,OAAA;AAAA,GACJ,CAAA;AACJ,CAAA;AAOgB,SAAA,eAAA,CACZ,WACA,OAGF,EAAA;AACE,EAAM,MAAA,QAAA,GAAW,SAAS,QAAY,IAAA,gBAAA,CAAA;AACtC,EAAM,MAAA,GAAA,GAAM,CAAG,EAAA,QAAA,CAAA,CAAA,EAAY,MAAO,EAAA,CAAA,CAAA,CAAA;AAClC,EAAe,cAAA,CAAA,MAAA,CAAO,KAAK,SAAS,CAAA,CAAA;AACpC,EAAO,OAAA,GAAA,CAAA;AACX;;;;"}
1
+ {"version":3,"file":"web-components.js","sources":["web-components.ts"],"sourcesContent":["// SPDX-FileCopyrightText: con terra GmbH and contributors\n// SPDX-License-Identifier: Apache-2.0\nimport { waitFor, within } from \"@testing-library/dom\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst GLOBAL = global as any;\n\nfunction nextId(): number {\n GLOBAL[\"__WEB_COMPONENT_COUNT__\"] ??= 0;\n const id = (GLOBAL[\"__WEB_COMPONENT_COUNT__\"] += 1);\n return id;\n}\n\n/**\n * Renders the given component into the DOM and returns the new node.\n */\nexport async function renderComponent(\n component: CustomElementConstructor | string,\n options?: {\n container?: HTMLElement;\n attributes?: Record<string, string>;\n }\n) {\n const tag = typeof component === \"string\" ? component : defineComponent(component);\n const container = options?.container ?? document.body;\n const node = container.ownerDocument.createElement(tag);\n for (const [key, value] of Object.entries(options?.attributes ?? {})) {\n node.setAttribute(key, value);\n }\n container.innerHTML = \"\";\n container.appendChild(node);\n return {\n node\n };\n}\n\n/**\n * Renders the given component into the DOM (via {@link renderComponent}) and works on its shadow root.\n * In order to use this function, the shadow root should be attached as `open` from inside the component class.\n *\n * After the shadow root has been accessed, the function searches (and waits) for an inner root container (by default `.pioneer-root`)\n * where all other searches should be executed.\n *\n * Returns the shadow root, the inner container, and a bound queries object that automatically searches in the inner container\n * instead of the whole document.\n */\nexport async function renderComponentShadowDOM(\n component: CustomElementConstructor | string,\n options?: {\n container?: HTMLElement;\n attributes?: Record<string, string>;\n innerContainerSelector?: string;\n }\n) {\n const { node } = await renderComponent(component, options);\n const selector = options?.innerContainerSelector ?? \".pioneer-root\";\n const { shadowRoot, innerContainer } = await waitFor(() => {\n const shadowRoot = node.shadowRoot;\n if (!shadowRoot) {\n throw new Error(\"Shadow root not attached.\");\n }\n const innerContainer = shadowRoot.querySelector<HTMLElement>(selector);\n if (!innerContainer) {\n throw new Error(\"Inner container not ready.\");\n }\n return { shadowRoot, innerContainer };\n });\n\n const queries = within(innerContainer);\n return {\n node,\n shadowRoot,\n innerContainer,\n queries\n };\n}\n\n/**\n * Defines the given component and returns the unique tag name.\n * This helper is necessary because tag names must not collide in the global elements registry (and\n * un-registration is not possible).\n */\nexport function defineComponent(\n component: CustomElementConstructor,\n options?: {\n nameHint?: string;\n }\n) {\n const nameHint = options?.nameHint ?? \"test-component\";\n const tag = `${nameHint}-${nextId()}`;\n customElements.define(tag, component);\n return tag;\n}\n"],"names":["shadowRoot","innerContainer"],"mappings":";;AAKA,MAAM,MAAS,GAAA,MAAA,CAAA;AAEf,SAAS,MAAiB,GAAA;AACtB,EAAA,MAAA,CAAO,yBAAyB,CAAM,KAAA,CAAA,CAAA;AACtC,EAAM,MAAA,EAAA,GAAM,MAAO,CAAA,yBAAyB,CAAK,IAAA,CAAA,CAAA;AACjD,EAAO,OAAA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