Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/core/test/src/core_legacy_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ void main() {

testWidgets('tsb.build', (tester) async {
const html = '<span class="build-op">Foo</span>';
const abcdef = Color(0x00abcdef);
final buildOp = BuildOp(
onTree: (_, tree) => tree.append(
WidgetBit.block(
tree,
WidgetPlaceholder(
builder: (context, child) {
final style = tree.tsb.build(context).style;
final colored = style.copyWith(color: const Color(0x00abcdef));
final colored = style.copyWith(color: abcdef);
return Text('hi', style: colored);
},
),
Expand All @@ -83,7 +84,10 @@ void main() {
),
useExplainer: false,
);
expect(explained, contains('0x00abcdef'));

// TODO: use hard coded value when our minimum Flutter version > 3.24
final abcdefString = abcdef.toString().replaceAll('ColorSpace.', '');
expect(explained, contains(abcdefString));
});
});

Expand Down
10 changes: 8 additions & 2 deletions packages/core/test/tag_li_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1000,14 +1000,20 @@ Future<void> main() async {
'<ul style="color: #f00"><li>Foo</li></ul>',
useExplainer: false,
);
expect(disc, contains('Color(0xffff0000)'));

// TODO: use hard coded value when our minimum Flutter version > 3.24
const red = Color(0xffff0000);
expect(disc, contains(red.toString().replaceAll('ColorSpace.', '')));

final circle = await explain(
tester,
'<ul style="color: #0f0"><li>Foo</li></ul>',
useExplainer: false,
);
expect(circle, contains('Color(0xff00ff00)'));

// TODO: use hard coded value when our minimum Flutter version > 3.24
const green = Color(0xff00ff00);
expect(circle, contains(green.toString().replaceAll('ColorSpace.', '')));
});
});
}
Expand Down
Loading