Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MartenM committed Feb 18, 2024
1 parent 07afbe8 commit f064757
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions test/flutter_bbcode_internal_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bbcode/flutter_bbcode.dart';
import 'package:flutter_test/flutter_test.dart';

Widget createTestWidget(Widget child) {
return MaterialApp(
home: Scaffold(
body: child,
),
);
}

void main() {
group("BBStylesheet tests", () {
test("Copy test (no new variables)", () {
var initial = defaultBBStylesheet();
var copy = initial.copyWith();

expect(initial.tags, copy.tags);
expect(initial.defaultTextStyle, copy.defaultTextStyle);
expect(initial.selectableText, copy.selectableText);
});

test("Copy test (all new variables)", () {
var newStyle = TextStyle(fontSize: 999);

var initial = defaultBBStylesheet();
var copy = initial.copyWith(
defaultTextStyle: newStyle,
selectableText: true
);

expect(initial.tags, copy.tags);
expect(copy.defaultTextStyle, newStyle);
expect(copy.selectableText, true);
});


});


}

0 comments on commit f064757

Please sign in to comment.