(element, text)
| 264 | * @return {Promise} |
| 265 | */ |
| 266 | export const expectTextContent = async (element, text) => { |
| 267 | await wait(() => { |
| 268 | const textContent = getNodeText(element); |
| 269 | if (textContent !== text) { |
| 270 | throw new Error( |
| 271 | `Text content not yet what is expected. Got: ${textContent}. Expecting: ${text}.` |
| 272 | ); |
| 273 | } else { |
| 274 | expect(textContent).toBe(text); |
| 275 | } |
| 276 | }); |
| 277 | }; |
| 278 | |
| 279 | const ucfirst = str => `${str[0].toUpperCase()}${str.slice(1)}`; |
| 280 |