Skip to content

Commit 5dbf4ac

Browse files
author
Katie George
committed
chore: Updates snapshots
1 parent 6f3b672 commit 5dbf4ac

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

src/__tests__/__snapshots__/documenter.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ exports[`definition for support-prompt-group matches the snapshot > support-prom
237237
"parameters": [
238238
{
239239
"name": "itemId",
240-
"type": "number",
240+
"type": "string",
241241
},
242242
],
243243
"returnType": "void",

src/__tests__/__snapshots__/test-utils-wrappers.test.tsx.snap

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ export { ElementWrapper };
1717
import LoadingBarWrapper from './loading-bar';
1818
export { LoadingBarWrapper };
1919
20+
21+
import SupportPromptGroupWrapper from './support-prompt-group';
22+
export { SupportPromptGroupWrapper };
23+
2024
declare module '@cloudscape-design/test-utils-core/dist/dom' {
2125
interface ElementWrapper {
2226
@@ -79,6 +83,26 @@ declare module '@cloudscape-design/test-utils-core/dist/dom' {
7983
* @returns {Array<LoadingBarWrapper>}
8084
*/
8185
findAllLoadingBars(selector?: string): Array<LoadingBarWrapper>;
86+
87+
/**
88+
* Returns the wrapper of the first SupportPromptGroup that matches the specified CSS selector.
89+
* If no CSS selector is specified, returns the wrapper of the first SupportPromptGroup.
90+
* If no matching SupportPromptGroup is found, returns \`null\`.
91+
*
92+
* @param {string} [selector] CSS Selector
93+
* @returns {SupportPromptGroupWrapper | null}
94+
*/
95+
findSupportPromptGroup(selector?: string): SupportPromptGroupWrapper | null;
96+
97+
/**
98+
* Returns an array of SupportPromptGroup wrapper that matches the specified CSS selector.
99+
* If no CSS selector is specified, returns all of the SupportPromptGroups inside the current wrapper.
100+
* If no matching SupportPromptGroup is found, returns an empty array.
101+
*
102+
* @param {string} [selector] CSS Selector
103+
* @returns {Array<SupportPromptGroupWrapper>}
104+
*/
105+
findAllSupportPromptGroups(selector?: string): Array<SupportPromptGroupWrapper>;
82106
}
83107
}
84108
@@ -114,6 +138,17 @@ declare module '@cloudscape-design/test-utils-core/dist/dom' {
114138
ElementWrapper.prototype.findAllLoadingBars = function(selector) {
115139
return this.findAllComponents(LoadingBarWrapper, selector);
116140
};
141+
142+
ElementWrapper.prototype.findSupportPromptGroup = function(selector) {
143+
const rootSelector = \`.\${SupportPromptGroupWrapper.rootSelector}\`;
144+
// casting to 'any' is needed to avoid this issue with generics
145+
// https://github.com/microsoft/TypeScript/issues/29132
146+
return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, SupportPromptGroupWrapper);
147+
};
148+
149+
ElementWrapper.prototype.findAllSupportPromptGroups = function(selector) {
150+
return this.findAllComponents(SupportPromptGroupWrapper, selector);
151+
};
117152
export default function wrapper(root: Element = document.body) { if (document && document.body && !document.body.contains(root)) { console.warn('[AwsUi] [test-utils] provided element is not part of the document body, interactions may work incorrectly')}; return new ElementWrapper(root); }"
118153
`;
119154
@@ -134,6 +169,10 @@ export { ElementWrapper };
134169
import LoadingBarWrapper from './loading-bar';
135170
export { LoadingBarWrapper };
136171
172+
173+
import SupportPromptGroupWrapper from './support-prompt-group';
174+
export { SupportPromptGroupWrapper };
175+
137176
declare module '@cloudscape-design/test-utils-core/dist/selectors' {
138177
interface ElementWrapper {
139178
@@ -190,6 +229,24 @@ declare module '@cloudscape-design/test-utils-core/dist/selectors' {
190229
* @returns {MultiElementWrapper<LoadingBarWrapper>}
191230
*/
192231
findAllLoadingBars(selector?: string): MultiElementWrapper<LoadingBarWrapper>;
232+
233+
/**
234+
* Returns a wrapper that matches the SupportPromptGroups with the specified CSS selector.
235+
* If no CSS selector is specified, returns a wrapper that matches SupportPromptGroups.
236+
*
237+
* @param {string} [selector] CSS Selector
238+
* @returns {SupportPromptGroupWrapper}
239+
*/
240+
findSupportPromptGroup(selector?: string): SupportPromptGroupWrapper;
241+
242+
/**
243+
* Returns a multi-element wrapper that matches SupportPromptGroups with the specified CSS selector.
244+
* If no CSS selector is specified, returns a multi-element wrapper that matches SupportPromptGroups.
245+
*
246+
* @param {string} [selector] CSS Selector
247+
* @returns {MultiElementWrapper<SupportPromptGroupWrapper>}
248+
*/
249+
findAllSupportPromptGroups(selector?: string): MultiElementWrapper<SupportPromptGroupWrapper>;
193250
}
194251
}
195252
@@ -225,5 +282,16 @@ declare module '@cloudscape-design/test-utils-core/dist/selectors' {
225282
ElementWrapper.prototype.findAllLoadingBars = function(selector) {
226283
return this.findAllComponents(LoadingBarWrapper, selector);
227284
};
285+
286+
ElementWrapper.prototype.findSupportPromptGroup = function(selector) {
287+
const rootSelector = \`.\${SupportPromptGroupWrapper.rootSelector}\`;
288+
// casting to 'any' is needed to avoid this issue with generics
289+
// https://github.com/microsoft/TypeScript/issues/29132
290+
return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, SupportPromptGroupWrapper);
291+
};
292+
293+
ElementWrapper.prototype.findAllSupportPromptGroups = function(selector) {
294+
return this.findAllComponents(SupportPromptGroupWrapper, selector);
295+
};
228296
export default function wrapper(root: string = 'body') { return new ElementWrapper(root); }"
229297
`;

0 commit comments

Comments
 (0)