Skip to content

Commit 25edfab

Browse files
committed
Missed some bind
1 parent 31eec83 commit 25edfab

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

test/matchers/element/toHaveComputedRole.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Received : "WebdriverIO"`
101101
const el = await $('sel')
102102
vi.mocked(el.getComputedRole).mockResolvedValueOnce('WebdriverIO')
103103

104-
const result = await toHaveComputedRole.bind({ isNot: true })(el, 'foobar', { wait: 1 })
104+
const result = await thisNotContext.toHaveComputedRole(el, 'foobar', { wait: 1 })
105105

106106
expect(result.pass).toBe(true)
107107
})
@@ -110,7 +110,7 @@ Received : "WebdriverIO"`
110110
const el = await $('sel')
111111
vi.mocked(el.getComputedRole).mockResolvedValueOnce('WebdriverIO')
112112

113-
const result = await toHaveComputedRole.bind({})(el, 'BrowserdriverIO', {
113+
const result = await thisContext.toHaveComputedRole(el, 'BrowserdriverIO', {
114114
replace: ['Web', 'Browser'],
115115
})
116116
expect(result.pass).toBe(true)
@@ -120,7 +120,7 @@ Received : "WebdriverIO"`
120120
const el = await $('sel')
121121
vi.mocked(el.getComputedRole).mockResolvedValueOnce('WebdriverIO')
122122

123-
const result = await toHaveComputedRole.bind({})(el, 'BrowserdriverIO', {
123+
const result = await thisContext.toHaveComputedRole(el, 'BrowserdriverIO', {
124124
replace: [['Web', 'Browser']],
125125
})
126126
expect(result.pass).toBe(true)
@@ -130,7 +130,7 @@ Received : "WebdriverIO"`
130130
const el = await $('sel')
131131
vi.mocked(el.getComputedRole).mockResolvedValueOnce('WebdriverIO')
132132

133-
const result = await toHaveComputedRole.bind({})(el, 'BrowserdriverIO', {
133+
const result = await thisContext.toHaveComputedRole(el, 'BrowserdriverIO', {
134134
replace: [[/Web/, 'Browser']],
135135
})
136136
expect(result.pass).toBe(true)
@@ -140,23 +140,23 @@ Received : "WebdriverIO"`
140140
const el = await $('sel')
141141
vi.mocked(el.getComputedRole).mockResolvedValueOnce('WebdriverIO')
142142

143-
const result = await toHaveComputedRole.bind({})(el, 'Webd', { atStart: true })
143+
const result = await thisContext.toHaveComputedRole(el, 'Webd', { atStart: true })
144144
expect(result.pass).toBe(true)
145145
})
146146

147147
test('should return true if actual computed role ends with expected computed role', async () => {
148148
const el = await $('sel')
149149
vi.mocked(el.getComputedRole).mockResolvedValueOnce('WebdriverIO')
150150

151-
const result = await toHaveComputedRole.bind({})(el, 'erIO', { atEnd: true })
151+
const result = await thisContext.toHaveComputedRole(el, 'erIO', { atEnd: true })
152152
expect(result.pass).toBe(true)
153153
})
154154

155155
test('should return true if actual computed role contains the expected computed role at the given index', async () => {
156156
const el = await $('sel')
157157
vi.mocked(el.getComputedRole).mockResolvedValueOnce('WebdriverIO')
158158

159-
const result = await toHaveComputedRole.bind({})(el, 'iver', { atIndex: 5 })
159+
const result = await thisContext.toHaveComputedRole(el, 'iver', { atIndex: 5 })
160160
expect(result.pass).toBe(true)
161161
})
162162

test/matchers/element/toHaveStyle.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Received : {"color": "#000", "font-family": "Faktum", "font-size": "26px"}`
105105
'color': '#fff'
106106
}
107107

108-
const result = await toHaveStyle.bind({ isNot: true })(el, wrongStyle, { wait: 0 })
108+
const result = await thisNotContext.toHaveStyle(el, wrongStyle, { wait: 0 })
109109

110110
expect(result.pass).toBe(true)
111111
})

test/matchers/element/toHaveText.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,15 @@ Received : "WebdriverIO"`)
259259
const el = await $('sel')
260260
vi.mocked(el.getText).mockResolvedValue('WebdriverIO')
261261

262-
const result = await toHaveText.bind({})(el, 'foobar', { trim: false, wait: 0 })
262+
const result = await thisContext.toHaveText(el, 'foobar', { trim: false, wait: 0 })
263263
expect(result.pass).toBe(false)
264264
})
265265

266266
test('should return true if texts strictly match without trimming', async () => {
267267
const el = await $('sel')
268268
vi.mocked(el.getText).mockResolvedValue('WebdriverIO')
269269

270-
const result = await toHaveText.bind({})(el, 'WebdriverIO', { trim: false, wait: 0 })
270+
const result = await thisContext.toHaveText(el, 'WebdriverIO', { trim: false, wait: 0 })
271271

272272
expect(result.pass).toBe(true)
273273
})

0 commit comments

Comments
 (0)