hasOuterHtml function

Matcher hasOuterHtml(
  1. String outerHtml
)

A matcher for checking the outerHTML of a HTMLElement.

Implementation

Matcher hasOuterHtml(String outerHtml) {
  return isA<web.HTMLElement>()
      .having((e) => e.instanceOfString('HTMLElement'), 'instanceOf(HTMLElement)', isTrue)
      // `outerHTML` is typed as `JSAny`, which only equals a Dart `String` when compiled to JS, not to Wasm.
      .having((e) => (e.outerHTML as JSString).toDart, 'outerHTML', outerHtml);
}