Skip to content

Commit 7d8505e

Browse files
YueyingLuYueying Lu
andauthored
chore: Update test utils wrappers snapshot (#93)
Co-authored-by: Yueying Lu <[email protected]>
1 parent 7e4367f commit 7d8505e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ findAllCodeViews(selector?: string): Array<CodeViewWrapper>;
4141
4242
4343
ElementWrapper.prototype.findCodeView = function(selector) {
44-
const rootSelector = \`.\${CodeViewWrapper.rootSelector}\`;
44+
let rootSelector = \`.\${CodeViewWrapper.rootSelector}\`;
45+
if("legacyRootSelector" in CodeViewWrapper && CodeViewWrapper.legacyRootSelector){
46+
rootSelector = \`:is(.\${CodeViewWrapper.rootSelector}, .\${CodeViewWrapper.legacyRootSelector})\`;
47+
}
4548
// casting to 'any' is needed to avoid this issue with generics
4649
// https://github.com/microsoft/TypeScript/issues/29132
4750
return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, CodeViewWrapper);
@@ -100,7 +103,10 @@ findAllCodeViews(selector?: string): MultiElementWrapper<CodeViewWrapper>;
100103
101104
102105
ElementWrapper.prototype.findCodeView = function(selector) {
103-
const rootSelector = \`.\${CodeViewWrapper.rootSelector}\`;
106+
let rootSelector = \`.\${CodeViewWrapper.rootSelector}\`;
107+
if("legacyRootSelector" in CodeViewWrapper && CodeViewWrapper.legacyRootSelector){
108+
rootSelector = \`:is(.\${CodeViewWrapper.rootSelector}, .\${CodeViewWrapper.legacyRootSelector})\`;
109+
}
104110
// casting to 'any' is needed to avoid this issue with generics
105111
// https://github.com/microsoft/TypeScript/issues/29132
106112
return (this as any).findComponent(selector ? appendSelector(selector, rootSelector) : rootSelector, CodeViewWrapper);

0 commit comments

Comments
 (0)