@cloudscape-design/chat-components 1.0.104 → 1.0.106
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/internal/api-docs/components/avatar.js +2 -0
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/test-utils/dom/index.d.ts +32 -0
- package/test-utils/dom/index.js +20 -0
- package/test-utils/dom/index.js.map +1 -1
|
@@ -49,6 +49,7 @@ module.exports = {
|
|
|
49
49
|
"angle-right",
|
|
50
50
|
"angle-up",
|
|
51
51
|
"angle-down",
|
|
52
|
+
"announcement",
|
|
52
53
|
"arrow-left",
|
|
53
54
|
"arrow-right",
|
|
54
55
|
"arrow-up",
|
|
@@ -108,6 +109,7 @@ module.exports = {
|
|
|
108
109
|
"insert-row",
|
|
109
110
|
"key",
|
|
110
111
|
"keyboard",
|
|
112
|
+
"light-dark",
|
|
111
113
|
"list-view",
|
|
112
114
|
"location-pin",
|
|
113
115
|
"lock-private",
|
package/internal/environment.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "chat-components";
|
|
2
|
-
export var PACKAGE_VERSION = "1.0.0 (
|
|
2
|
+
export var PACKAGE_VERSION = "1.0.0 (cd08e579)";
|
|
3
3
|
export var THEME = "open-source-visual-refresh";
|
|
4
4
|
export var SYSTEM = "core";
|
|
5
5
|
export var ALWAYS_VISUAL_REFRESH = true;
|
package/internal/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -28,6 +28,14 @@ declare module '@cloudscape-design/test-utils-core/dist/dom' {
|
|
|
28
28
|
* @returns {Array<AvatarWrapper>}
|
|
29
29
|
*/
|
|
30
30
|
findAllAvatars(selector?: string): Array<AvatarWrapper>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the wrapper of the closest parent Avatar for the current element,
|
|
33
|
+
* or the element itself if it is an instance of Avatar.
|
|
34
|
+
* If no Avatar is found, returns `null`.
|
|
35
|
+
*
|
|
36
|
+
* @returns {AvatarWrapper | null}
|
|
37
|
+
*/
|
|
38
|
+
findClosestAvatar(): AvatarWrapper | null;
|
|
31
39
|
/**
|
|
32
40
|
* Returns the wrapper of the first ChatBubble that matches the specified CSS selector.
|
|
33
41
|
* If no CSS selector is specified, returns the wrapper of the first ChatBubble.
|
|
@@ -46,6 +54,14 @@ declare module '@cloudscape-design/test-utils-core/dist/dom' {
|
|
|
46
54
|
* @returns {Array<ChatBubbleWrapper>}
|
|
47
55
|
*/
|
|
48
56
|
findAllChatBubbles(selector?: string): Array<ChatBubbleWrapper>;
|
|
57
|
+
/**
|
|
58
|
+
* Returns the wrapper of the closest parent ChatBubble for the current element,
|
|
59
|
+
* or the element itself if it is an instance of ChatBubble.
|
|
60
|
+
* If no ChatBubble is found, returns `null`.
|
|
61
|
+
*
|
|
62
|
+
* @returns {ChatBubbleWrapper | null}
|
|
63
|
+
*/
|
|
64
|
+
findClosestChatBubble(): ChatBubbleWrapper | null;
|
|
49
65
|
/**
|
|
50
66
|
* Returns the wrapper of the first LoadingBar that matches the specified CSS selector.
|
|
51
67
|
* If no CSS selector is specified, returns the wrapper of the first LoadingBar.
|
|
@@ -64,6 +80,14 @@ declare module '@cloudscape-design/test-utils-core/dist/dom' {
|
|
|
64
80
|
* @returns {Array<LoadingBarWrapper>}
|
|
65
81
|
*/
|
|
66
82
|
findAllLoadingBars(selector?: string): Array<LoadingBarWrapper>;
|
|
83
|
+
/**
|
|
84
|
+
* Returns the wrapper of the closest parent LoadingBar for the current element,
|
|
85
|
+
* or the element itself if it is an instance of LoadingBar.
|
|
86
|
+
* If no LoadingBar is found, returns `null`.
|
|
87
|
+
*
|
|
88
|
+
* @returns {LoadingBarWrapper | null}
|
|
89
|
+
*/
|
|
90
|
+
findClosestLoadingBar(): LoadingBarWrapper | null;
|
|
67
91
|
/**
|
|
68
92
|
* Returns the wrapper of the first SupportPromptGroup that matches the specified CSS selector.
|
|
69
93
|
* If no CSS selector is specified, returns the wrapper of the first SupportPromptGroup.
|
|
@@ -82,6 +106,14 @@ declare module '@cloudscape-design/test-utils-core/dist/dom' {
|
|
|
82
106
|
* @returns {Array<SupportPromptGroupWrapper>}
|
|
83
107
|
*/
|
|
84
108
|
findAllSupportPromptGroups(selector?: string): Array<SupportPromptGroupWrapper>;
|
|
109
|
+
/**
|
|
110
|
+
* Returns the wrapper of the closest parent SupportPromptGroup for the current element,
|
|
111
|
+
* or the element itself if it is an instance of SupportPromptGroup.
|
|
112
|
+
* If no SupportPromptGroup is found, returns `null`.
|
|
113
|
+
*
|
|
114
|
+
* @returns {SupportPromptGroupWrapper | null}
|
|
115
|
+
*/
|
|
116
|
+
findClosestSupportPromptGroup(): SupportPromptGroupWrapper | null;
|
|
85
117
|
}
|
|
86
118
|
}
|
|
87
119
|
export default function wrapper(root?: Element): ElementWrapper<Element>;
|
package/test-utils/dom/index.js
CHANGED
|
@@ -62,6 +62,26 @@ dom_1.ElementWrapper.prototype.findSupportPromptGroup = function (selector) {
|
|
|
62
62
|
dom_1.ElementWrapper.prototype.findAllSupportPromptGroups = function (selector) {
|
|
63
63
|
return this.findAllComponents(support_prompt_group_1.default, selector);
|
|
64
64
|
};
|
|
65
|
+
dom_1.ElementWrapper.prototype.findClosestAvatar = function () {
|
|
66
|
+
// casting to 'any' is needed to avoid this issue with generics
|
|
67
|
+
// https://github.com/microsoft/TypeScript/issues/29132
|
|
68
|
+
return this.findClosestComponent(avatar_1.default);
|
|
69
|
+
};
|
|
70
|
+
dom_1.ElementWrapper.prototype.findClosestChatBubble = function () {
|
|
71
|
+
// casting to 'any' is needed to avoid this issue with generics
|
|
72
|
+
// https://github.com/microsoft/TypeScript/issues/29132
|
|
73
|
+
return this.findClosestComponent(chat_bubble_1.default);
|
|
74
|
+
};
|
|
75
|
+
dom_1.ElementWrapper.prototype.findClosestLoadingBar = function () {
|
|
76
|
+
// casting to 'any' is needed to avoid this issue with generics
|
|
77
|
+
// https://github.com/microsoft/TypeScript/issues/29132
|
|
78
|
+
return this.findClosestComponent(loading_bar_1.default);
|
|
79
|
+
};
|
|
80
|
+
dom_1.ElementWrapper.prototype.findClosestSupportPromptGroup = function () {
|
|
81
|
+
// casting to 'any' is needed to avoid this issue with generics
|
|
82
|
+
// https://github.com/microsoft/TypeScript/issues/29132
|
|
83
|
+
return this.findClosestComponent(support_prompt_group_1.default);
|
|
84
|
+
};
|
|
65
85
|
function wrapper(root = document.body) {
|
|
66
86
|
if (document && document.body && !document.body.contains(root)) {
|
|
67
87
|
console.warn('[AwsUi] [test-utils] provided element is not part of the document body, interactions may work incorrectly');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/test-utils/dom/index.ts"],"names":[],"mappings":";;;AACA,qEAAqE;AACrE,sCAAsC;AACtC,gEAAwE;AAG/D,+FAHA,oBAAc,OAGA;AAFvB,oEAA0E;AAI1E,qCAAqC;AAM5B,wBANF,gBAAa,CAME;AALtB,+CAA8C;AAMrC,4BANF,qBAAiB,CAME;AAL1B,+CAA8C;AAMrC,4BANF,qBAAiB,CAME;AAL1B,iEAA+D;AAMtD,oCANF,8BAAyB,CAME;AAqFlC,oBAAc,CAAC,SAAS,CAAC,UAAU,GAAG,UAAS,QAAQ;IACrD,IAAI,YAAY,GAAG,IAAI,gBAAa,CAAC,YAAY,EAAE,CAAC;IACpD,IAAG,oBAAoB,IAAI,gBAAa,IAAI,gBAAa,CAAC,kBAAkB,EAAC;QAC3E,YAAY,GAAG,QAAQ,gBAAa,CAAC,YAAY,MAAM,gBAAa,CAAC,kBAAkB,GAAG,CAAC;KAC5F;IACD,+DAA+D;IAC/D,uDAAuD;IACvD,OAAQ,IAAY,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,sBAAc,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,gBAAa,CAAC,CAAC;AACtH,CAAC,CAAC;AAEF,oBA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-utils-core/dom';\nimport { appendSelector } from '@cloudscape-design/test-utils-core/utils';\n\nexport { ElementWrapper };\n\nimport AvatarWrapper from './avatar';\nimport ChatBubbleWrapper from './chat-bubble';\nimport LoadingBarWrapper from './loading-bar';\nimport SupportPromptGroupWrapper from './support-prompt-group';\n\n\nexport { AvatarWrapper };\nexport { ChatBubbleWrapper };\nexport { LoadingBarWrapper };\nexport { SupportPromptGroupWrapper };\n\ndeclare module '@cloudscape-design/test-utils-core/dist/dom' {\n interface ElementWrapper {\n \n/**\n * Returns the wrapper of the first Avatar that matches the specified CSS selector.\n * If no CSS selector is specified, returns the wrapper of the first Avatar.\n * If no matching Avatar is found, returns `null`.\n *\n * @param {string} [selector] CSS Selector\n * @returns {AvatarWrapper | null}\n */\nfindAvatar(selector?: string): AvatarWrapper | null;\n\n/**\n * Returns an array of Avatar wrapper that matches the specified CSS selector.\n * If no CSS selector is specified, returns all of the Avatars inside the current wrapper.\n * If no matching Avatar is found, returns an empty array.\n *\n * @param {string} [selector] CSS Selector\n * @returns {Array<AvatarWrapper>}\n */\nfindAllAvatars(selector?: string): Array<AvatarWrapper>;\n/**\n * Returns the wrapper of the first ChatBubble that matches the specified CSS selector.\n * If no CSS selector is specified, returns the wrapper of the first ChatBubble.\n * If no matching ChatBubble is found, returns `null`.\n *\n * @param {string} [selector] CSS Selector\n * @returns {ChatBubbleWrapper | null}\n */\nfindChatBubble(selector?: string): ChatBubbleWrapper | null;\n\n/**\n * Returns an array of ChatBubble wrapper that matches the specified CSS selector.\n * If no CSS selector is specified, returns all of the ChatBubbles inside the current wrapper.\n * If no matching ChatBubble is found, returns an empty array.\n *\n * @param {string} [selector] CSS Selector\n * @returns {Array<ChatBubbleWrapper>}\n */\nfindAllChatBubbles(selector?: string): Array<ChatBubbleWrapper>;\n/**\n * Returns the wrapper of the first LoadingBar that matches the specified CSS selector.\n * If no CSS selector is specified, returns the wrapper of the first LoadingBar.\n * If no matching LoadingBar is found, returns `null`.\n *\n * @param {string} [selector] CSS Selector\n * @returns {LoadingBarWrapper | null}\n */\nfindLoadingBar(selector?: string): LoadingBarWrapper | null;\n\n/**\n * Returns an array of LoadingBar wrapper that matches the specified CSS selector.\n * If no CSS selector is specified, returns all of the LoadingBars inside the current wrapper.\n * If no matching LoadingBar is found, returns an empty array.\n *\n * @param {string} [selector] CSS Selector\n * @returns {Array<LoadingBarWrapper>}\n */\nfindAllLoadingBars(selector?: string): Array<LoadingBarWrapper>;\n/**\n * Returns the wrapper of the first SupportPromptGroup that matches the specified CSS selector.\n * If no CSS selector is specified, returns the wrapper of the first SupportPromptGroup.\n * If no matching SupportPromptGroup is found, returns `null`.\n *\n * @param {string} [selector] CSS Selector\n * @returns {SupportPromptGroupWrapper | null}\n */\nfindSupportPromptGroup(selector?: string): SupportPromptGroupWrapper | null;\n\n/**\n * Returns an array of SupportPromptGroup wrapper that matches the specified CSS selector.\n * If no CSS selector is specified, returns all of the SupportPromptGroups inside the current wrapper.\n * If no matching SupportPromptGroup is found, returns an empty array.\n *\n * @param {string} [selector] CSS Selector\n * @returns {Array<SupportPromptGroupWrapper>}\n */\nfindAllSupportPromptGroups(selector?: string): Array<SupportPromptGroupWrapper>;\n }\n}\n\n\nElementWrapper.prototype.findAvatar = function(selector) {\n let rootSelector = `.${AvatarWrapper.rootSelector}`;\n if(\"legacyRootSelector\" in AvatarWrapper && AvatarWrapper.legacyRootSelector){\n rootSelector = `:is(.${AvatarWrapper.rootSelector}, .${AvatarWrapper.legacyRootSelector})`;\n }\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, AvatarWrapper);\n};\n\nElementWrapper.prototype.findAllAvatars = function(selector) {\n return this.findAllComponents(AvatarWrapper, selector);\n};\nElementWrapper.prototype.findChatBubble = function(selector) {\n let rootSelector = `.${ChatBubbleWrapper.rootSelector}`;\n if(\"legacyRootSelector\" in ChatBubbleWrapper && ChatBubbleWrapper.legacyRootSelector){\n rootSelector = `:is(.${ChatBubbleWrapper.rootSelector}, .${ChatBubbleWrapper.legacyRootSelector})`;\n }\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, ChatBubbleWrapper);\n};\n\nElementWrapper.prototype.findAllChatBubbles = function(selector) {\n return this.findAllComponents(ChatBubbleWrapper, selector);\n};\nElementWrapper.prototype.findLoadingBar = function(selector) {\n let rootSelector = `.${LoadingBarWrapper.rootSelector}`;\n if(\"legacyRootSelector\" in LoadingBarWrapper && LoadingBarWrapper.legacyRootSelector){\n rootSelector = `:is(.${LoadingBarWrapper.rootSelector}, .${LoadingBarWrapper.legacyRootSelector})`;\n }\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, LoadingBarWrapper);\n};\n\nElementWrapper.prototype.findAllLoadingBars = function(selector) {\n return this.findAllComponents(LoadingBarWrapper, selector);\n};\nElementWrapper.prototype.findSupportPromptGroup = function(selector) {\n let rootSelector = `.${SupportPromptGroupWrapper.rootSelector}`;\n if(\"legacyRootSelector\" in SupportPromptGroupWrapper && SupportPromptGroupWrapper.legacyRootSelector){\n rootSelector = `:is(.${SupportPromptGroupWrapper.rootSelector}, .${SupportPromptGroupWrapper.legacyRootSelector})`;\n }\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, SupportPromptGroupWrapper);\n};\n\nElementWrapper.prototype.findAllSupportPromptGroups = function(selector) {\n return this.findAllComponents(SupportPromptGroupWrapper, selector);\n};\n\n\nexport default function wrapper(root: Element = document.body) {\n if (document && document.body && !document.body.contains(root)) {\n console.warn('[AwsUi] [test-utils] provided element is not part of the document body, interactions may work incorrectly')\n };\n return new ElementWrapper(root);\n}\n"]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GAA2G,CAAC,CAAA;KAC1H;IAAA,CAAC;IACF,OAAO,IAAI,oBAAc,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AALD,0BAKC","sourcesContent":["\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ElementWrapper } from '@cloudscape-design/test-utils-core/dom';\nimport { appendSelector } from '@cloudscape-design/test-utils-core/utils';\n\nexport { ElementWrapper };\n\nimport AvatarWrapper from './avatar';\nimport ChatBubbleWrapper from './chat-bubble';\nimport LoadingBarWrapper from './loading-bar';\nimport SupportPromptGroupWrapper from './support-prompt-group';\n\n\nexport { AvatarWrapper };\nexport { ChatBubbleWrapper };\nexport { LoadingBarWrapper };\nexport { SupportPromptGroupWrapper };\n\ndeclare module '@cloudscape-design/test-utils-core/dist/dom' {\n interface ElementWrapper {\n \n/**\n * Returns the wrapper of the first Avatar that matches the specified CSS selector.\n * If no CSS selector is specified, returns the wrapper of the first Avatar.\n * If no matching Avatar is found, returns `null`.\n *\n * @param {string} [selector] CSS Selector\n * @returns {AvatarWrapper | null}\n */\nfindAvatar(selector?: string): AvatarWrapper | null;\n\n/**\n * Returns an array of Avatar wrapper that matches the specified CSS selector.\n * If no CSS selector is specified, returns all of the Avatars inside the current wrapper.\n * If no matching Avatar is found, returns an empty array.\n *\n * @param {string} [selector] CSS Selector\n * @returns {Array<AvatarWrapper>}\n */\nfindAllAvatars(selector?: string): Array<AvatarWrapper>;\n\n/**\n * Returns the wrapper of the closest parent Avatar for the current element,\n * or the element itself if it is an instance of Avatar.\n * If no Avatar is found, returns `null`.\n *\n * @returns {AvatarWrapper | null}\n */\nfindClosestAvatar(): AvatarWrapper | null;\n/**\n * Returns the wrapper of the first ChatBubble that matches the specified CSS selector.\n * If no CSS selector is specified, returns the wrapper of the first ChatBubble.\n * If no matching ChatBubble is found, returns `null`.\n *\n * @param {string} [selector] CSS Selector\n * @returns {ChatBubbleWrapper | null}\n */\nfindChatBubble(selector?: string): ChatBubbleWrapper | null;\n\n/**\n * Returns an array of ChatBubble wrapper that matches the specified CSS selector.\n * If no CSS selector is specified, returns all of the ChatBubbles inside the current wrapper.\n * If no matching ChatBubble is found, returns an empty array.\n *\n * @param {string} [selector] CSS Selector\n * @returns {Array<ChatBubbleWrapper>}\n */\nfindAllChatBubbles(selector?: string): Array<ChatBubbleWrapper>;\n\n/**\n * Returns the wrapper of the closest parent ChatBubble for the current element,\n * or the element itself if it is an instance of ChatBubble.\n * If no ChatBubble is found, returns `null`.\n *\n * @returns {ChatBubbleWrapper | null}\n */\nfindClosestChatBubble(): ChatBubbleWrapper | null;\n/**\n * Returns the wrapper of the first LoadingBar that matches the specified CSS selector.\n * If no CSS selector is specified, returns the wrapper of the first LoadingBar.\n * If no matching LoadingBar is found, returns `null`.\n *\n * @param {string} [selector] CSS Selector\n * @returns {LoadingBarWrapper | null}\n */\nfindLoadingBar(selector?: string): LoadingBarWrapper | null;\n\n/**\n * Returns an array of LoadingBar wrapper that matches the specified CSS selector.\n * If no CSS selector is specified, returns all of the LoadingBars inside the current wrapper.\n * If no matching LoadingBar is found, returns an empty array.\n *\n * @param {string} [selector] CSS Selector\n * @returns {Array<LoadingBarWrapper>}\n */\nfindAllLoadingBars(selector?: string): Array<LoadingBarWrapper>;\n\n/**\n * Returns the wrapper of the closest parent LoadingBar for the current element,\n * or the element itself if it is an instance of LoadingBar.\n * If no LoadingBar is found, returns `null`.\n *\n * @returns {LoadingBarWrapper | null}\n */\nfindClosestLoadingBar(): LoadingBarWrapper | null;\n/**\n * Returns the wrapper of the first SupportPromptGroup that matches the specified CSS selector.\n * If no CSS selector is specified, returns the wrapper of the first SupportPromptGroup.\n * If no matching SupportPromptGroup is found, returns `null`.\n *\n * @param {string} [selector] CSS Selector\n * @returns {SupportPromptGroupWrapper | null}\n */\nfindSupportPromptGroup(selector?: string): SupportPromptGroupWrapper | null;\n\n/**\n * Returns an array of SupportPromptGroup wrapper that matches the specified CSS selector.\n * If no CSS selector is specified, returns all of the SupportPromptGroups inside the current wrapper.\n * If no matching SupportPromptGroup is found, returns an empty array.\n *\n * @param {string} [selector] CSS Selector\n * @returns {Array<SupportPromptGroupWrapper>}\n */\nfindAllSupportPromptGroups(selector?: string): Array<SupportPromptGroupWrapper>;\n\n/**\n * Returns the wrapper of the closest parent SupportPromptGroup for the current element,\n * or the element itself if it is an instance of SupportPromptGroup.\n * If no SupportPromptGroup is found, returns `null`.\n *\n * @returns {SupportPromptGroupWrapper | null}\n */\nfindClosestSupportPromptGroup(): SupportPromptGroupWrapper | null;\n }\n}\n\n\nElementWrapper.prototype.findAvatar = function(selector) {\n let rootSelector = `.${AvatarWrapper.rootSelector}`;\n if(\"legacyRootSelector\" in AvatarWrapper && AvatarWrapper.legacyRootSelector){\n rootSelector = `:is(.${AvatarWrapper.rootSelector}, .${AvatarWrapper.legacyRootSelector})`;\n }\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, AvatarWrapper);\n};\n\nElementWrapper.prototype.findAllAvatars = function(selector) {\n return this.findAllComponents(AvatarWrapper, selector);\n};\nElementWrapper.prototype.findChatBubble = function(selector) {\n let rootSelector = `.${ChatBubbleWrapper.rootSelector}`;\n if(\"legacyRootSelector\" in ChatBubbleWrapper && ChatBubbleWrapper.legacyRootSelector){\n rootSelector = `:is(.${ChatBubbleWrapper.rootSelector}, .${ChatBubbleWrapper.legacyRootSelector})`;\n }\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, ChatBubbleWrapper);\n};\n\nElementWrapper.prototype.findAllChatBubbles = function(selector) {\n return this.findAllComponents(ChatBubbleWrapper, selector);\n};\nElementWrapper.prototype.findLoadingBar = function(selector) {\n let rootSelector = `.${LoadingBarWrapper.rootSelector}`;\n if(\"legacyRootSelector\" in LoadingBarWrapper && LoadingBarWrapper.legacyRootSelector){\n rootSelector = `:is(.${LoadingBarWrapper.rootSelector}, .${LoadingBarWrapper.legacyRootSelector})`;\n }\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, LoadingBarWrapper);\n};\n\nElementWrapper.prototype.findAllLoadingBars = function(selector) {\n return this.findAllComponents(LoadingBarWrapper, selector);\n};\nElementWrapper.prototype.findSupportPromptGroup = function(selector) {\n let rootSelector = `.${SupportPromptGroupWrapper.rootSelector}`;\n if(\"legacyRootSelector\" in SupportPromptGroupWrapper && SupportPromptGroupWrapper.legacyRootSelector){\n rootSelector = `:is(.${SupportPromptGroupWrapper.rootSelector}, .${SupportPromptGroupWrapper.legacyRootSelector})`;\n }\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, SupportPromptGroupWrapper);\n};\n\nElementWrapper.prototype.findAllSupportPromptGroups = function(selector) {\n return this.findAllComponents(SupportPromptGroupWrapper, selector);\n};\n\nElementWrapper.prototype.findClosestAvatar = function() {\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findClosestComponent(AvatarWrapper);\n};\nElementWrapper.prototype.findClosestChatBubble = function() {\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findClosestComponent(ChatBubbleWrapper);\n};\nElementWrapper.prototype.findClosestLoadingBar = function() {\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findClosestComponent(LoadingBarWrapper);\n};\nElementWrapper.prototype.findClosestSupportPromptGroup = function() {\n // casting to 'any' is needed to avoid this issue with generics\n // https://github.com/microsoft/TypeScript/issues/29132\n return (this as any).findClosestComponent(SupportPromptGroupWrapper);\n};\n\nexport default function wrapper(root: Element = document.body) {\n if (document && document.body && !document.body.contains(root)) {\n console.warn('[AwsUi] [test-utils] provided element is not part of the document body, interactions may work incorrectly')\n };\n return new ElementWrapper(root);\n}\n"]}
|