mariposa_test 1.1.0 copy "mariposa_test: ^1.1.0" to clipboard
mariposa_test: ^1.1.0 copied to clipboard

Infrastructure for unit-testing Mariposa widgets.

example/main.dart

import 'package:html_builder/elements.dart';
import 'package:mariposa_test/mariposa_test.dart';
import 'package:test/test.dart';

void main() {
  test('hasTagName', () {
    expect(br(), hasTagName('br'));
  });

  test('hasAttributes', () {
    expect(
      h('p', {'foo': 'bar', 'baz': 'quux'}),
      allOf(
        hasAttributes(containsPair('foo', 'bar')),
        isNot(hasAttributes(containsPair('foo', 'baz'))),
      ),
    );
  });

  test('hasChildren', () {
    expect(
      div(c: [br()]),
      allOf(
        hasChildren(anyElement(rendersTo('<br>'))),
        isNot(hasChildren(anyElement(rendersTo('<hr>')))),
      ),
    );
  });
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Infrastructure for unit-testing Mariposa widgets.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

angel_container, html, html_builder, mariposa, matcher, tuple

More

Packages that depend on mariposa_test