MCPcopy Create free account
hub / github.com/ZeeCoder/container-query / expectTextContent

Function expectTextContent

tests/utils/index.js:266–277  ·  view source on GitHub ↗
(element, text)

Source from the content-addressed store, hash-verified

264 * @return {Promise}
265 */
266export 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
279const ucfirst = str => `${str[0].toUpperCase()}${str.slice(1)}`;
280

Callers 1

index.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected