Skip to content

Commit 74084e3

Browse files
committed
Review toHaveText.test.ts
1 parent 3f33ee4 commit 74084e3

3 files changed

Lines changed: 191 additions & 188 deletions

File tree

src/matchers/element/toHaveText.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function condition(el: WebdriverIO.Element | WebdriverIO.ElementArray, tex
3838
}
3939

4040
export async function toHaveText(
41-
received: ChainablePromiseElement | ChainablePromiseArray,
41+
received: ChainablePromiseElement | ChainablePromiseArray | WebdriverIO.Element,
4242
expectedValue: string | RegExp | WdioAsymmetricMatcher<string> | Array<string | RegExp>,
4343
options: ExpectWebdriverIO.StringOptions = DEFAULT_OPTIONS
4444
) {

test/__mocks__/@wdio/globals.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const getElementMethods = () => ({
2020
getHTML: vi.spyOn({ getHTML: async () => { return '<Html/>' } }, 'getHTML'),
2121
getComputedLabel: vi.spyOn({ getComputedLabel: async () => 'Computed Label' }, 'getComputedLabel'),
2222
getComputedRole: vi.spyOn({ getComputedRole: async () => 'Computed Role' }, 'getComputedRole'),
23-
// Null is not part of the type, to fix in wdio one day
2423
getAttribute: vi.spyOn({ getAttribute: async (_attr: string) => 'some attribute' }, 'getAttribute'),
2524
getSize: vi.spyOn({ getSize: async (prop?: 'width' | 'height') => {
2625
if (prop === 'width') { return 100 }

0 commit comments

Comments
 (0)