Skip to main content

camouflage_skin_testing 0.1.1 copy "camouflage_skin_testing: ^0.1.1" to clipboard
camouflage_skin_testing: ^0.1.1 copied to clipboard

Test-only checks for any Camouflage skin: renderers apply behavior, and no literals.

camouflage_skin_testing #

pub package License Docs

Test-only checks for any Camouflage skin. Use it in the tests of a skin you write (or of an app that customizes one) to prove that renderers keep the component's behavior, honor every component-theme field, and meet the accessibility guidelines.

Add it as a dev dependency:

flutter pub add --dev camouflage_skin_testing

Features #

  • assertRendererAppliesBehavior: a click at the corner and one at the center of the rendered box both fire, and the node has a role. A renderer that applies the behavior inside its padding fails.
  • assertNoLiterals: renders with a theme full of odd values and checks the result, so a renderer with a hard-coded height or color fails.
  • expectAccessibleScreen: runs Flutter's tap-target and label guidelines over a gallery, in a theme, at a text scale and in a text direction.
  • Galleries (ButtonGallery, InputGallery, DialogGallery, ...): one screen per component family, for screenshot goldens and the checks above.
  • camoTestApp: your widget under a provider, with an overlay and the default shortcuts, at a text scale and direction.

Usage #

testWidgets('my skin keeps the button accessible', (tester) async {
  await expectAccessibleScreen(
    tester,
    skin: mySkin,
    theme: myTheme,
    child: const ButtonGallery(),
    textScale: 2,
  );
});

Every Camouflage skin package runs these checks in its own tests; see for example the *_accessibility_test.dart files in the repository.

Learn more #

License #

Apache License 2.0, see LICENSE.

0
likes
160
points
639
downloads

Documentation

Documentation
API reference

Publisher

verified publishersrctool.com

Weekly Downloads

Test-only checks for any Camouflage skin: renderers apply behavior, and no literals.

Repository (GitHub)
View/report issues
Contributing

Topics

#ui #design-system #theming #widget #accessibility

License

Apache-2.0 (license)

Dependencies

camouflage_core, flutter, flutter_test

More

Packages that depend on camouflage_skin_testing