UNPKG

@augment-vir/test

Version:

A universal testing suite that works with Mocha style test runners _and_ Node.js's built-in test runner.

13 lines (12 loc) 317 B
/** * Checks if a locator contains the given class. * * @category Internal */ export async function checkHasClass(locator, className) { if (!className) { return false; } const currentClassValue = (await locator.getAttribute('class')) || ''; return currentClassValue.includes(className); }