Skip to content

Commit

Permalink
test: add unit tests for typography text styles
Browse files Browse the repository at this point in the history
  • Loading branch information
thisissandipp committed Jul 5, 2024
1 parent 9051fb6 commit 30ac620
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/typography/text_styles_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:sudoku/typography/typography.dart';

void main() {
TestWidgetsFlutterBinding.ensureInitialized();
HttpOverrides.global = null;

group('SudokuTextStyle', () {
test('headlines are defined', () {
expect(SudokuTextStyle.headline1, isA<TextStyle>());
expect(SudokuTextStyle.headline2, isA<TextStyle>());
expect(SudokuTextStyle.headline3, isA<TextStyle>());
expect(SudokuTextStyle.headline4, isA<TextStyle>());
expect(SudokuTextStyle.headline5, isA<TextStyle>());
expect(SudokuTextStyle.headline6, isA<TextStyle>());
});

test('subtitles are defined', () {
expect(SudokuTextStyle.subtitle1, isA<TextStyle>());
expect(SudokuTextStyle.subtitle2, isA<TextStyle>());
});

test('body text are defined', () {
expect(SudokuTextStyle.bodyText1, isA<TextStyle>());
expect(SudokuTextStyle.bodyText2, isA<TextStyle>());
});

test('caption and button are defined', () {
expect(SudokuTextStyle.caption, isA<TextStyle>());
expect(SudokuTextStyle.button, isA<TextStyle>());
});
});
}

0 comments on commit 30ac620

Please sign in to comment.