Updated tests (#67083)
This commit is contained in:
parent
83e99f75c6
commit
0a130100ac
@ -3201,7 +3201,7 @@ void main() {
|
|||||||
controller: textController,
|
controller: textController,
|
||||||
decoration: null,
|
decoration: null,
|
||||||
inputFormatters: <TextInputFormatter> [
|
inputFormatters: <TextInputFormatter> [
|
||||||
BlacklistingTextInputFormatter(
|
FilteringTextInputFormatter.deny(
|
||||||
RegExp(r'[a-z]'),
|
RegExp(r'[a-z]'),
|
||||||
replacementString: '#',
|
replacementString: '#',
|
||||||
),
|
),
|
||||||
@ -3250,11 +3250,11 @@ void main() {
|
|||||||
decoration: null,
|
decoration: null,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
inputFormatters: <TextInputFormatter> [
|
inputFormatters: <TextInputFormatter> [
|
||||||
BlacklistingTextInputFormatter(
|
FilteringTextInputFormatter.deny(
|
||||||
RegExp(r'[a-z]'),
|
RegExp(r'[a-z]'),
|
||||||
replacementString: '12\n',
|
replacementString: '12\n',
|
||||||
),
|
),
|
||||||
WhitelistingTextInputFormatter(RegExp(r'\n[0-9]')),
|
FilteringTextInputFormatter.allow(RegExp(r'\n[0-9]')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
@ -3315,7 +3315,7 @@ void main() {
|
|||||||
controller: textController,
|
controller: textController,
|
||||||
decoration: null,
|
decoration: null,
|
||||||
inputFormatters: <TextInputFormatter> [
|
inputFormatters: <TextInputFormatter> [
|
||||||
WhitelistingTextInputFormatter.digitsOnly,
|
FilteringTextInputFormatter.digitsOnly,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -3635,7 +3635,7 @@ void main() {
|
|||||||
controller: textController,
|
controller: textController,
|
||||||
maxLength: 10,
|
maxLength: 10,
|
||||||
inputFormatters: <TextInputFormatter> [
|
inputFormatters: <TextInputFormatter> [
|
||||||
BlacklistingTextInputFormatter(
|
FilteringTextInputFormatter.deny(
|
||||||
RegExp(r'[a-z]'),
|
RegExp(r'[a-z]'),
|
||||||
replacementString: '#',
|
replacementString: '#',
|
||||||
),
|
),
|
||||||
|
@ -153,7 +153,7 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('cursorColor', () {
|
test('cursorColor', () {
|
||||||
expect(ThemeData(cursorColor: Colors.red).cursorColor, Colors.red);
|
expect(const TextSelectionThemeData(cursorColor: Colors.red).cursorColor, Colors.red);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('ThemeData.from a light color scheme sets appropriate values', (WidgetTester tester) async {
|
testWidgets('ThemeData.from a light color scheme sets appropriate values', (WidgetTester tester) async {
|
||||||
@ -430,9 +430,9 @@ void main() {
|
|||||||
toggleButtonsTheme: otherTheme.toggleButtonsTheme,
|
toggleButtonsTheme: otherTheme.toggleButtonsTheme,
|
||||||
buttonColor: otherTheme.buttonColor,
|
buttonColor: otherTheme.buttonColor,
|
||||||
secondaryHeaderColor: otherTheme.secondaryHeaderColor,
|
secondaryHeaderColor: otherTheme.secondaryHeaderColor,
|
||||||
textSelectionColor: otherTheme.textSelectionColor,
|
textSelectionColor: otherTheme.textSelectionTheme.selectionColor,
|
||||||
cursorColor: otherTheme.cursorColor,
|
cursorColor: otherTheme.textSelectionTheme.cursorColor,
|
||||||
textSelectionHandleColor: otherTheme.textSelectionHandleColor,
|
textSelectionHandleColor: otherTheme.textSelectionTheme.selectionHandleColor,
|
||||||
backgroundColor: otherTheme.backgroundColor,
|
backgroundColor: otherTheme.backgroundColor,
|
||||||
dialogBackgroundColor: otherTheme.dialogBackgroundColor,
|
dialogBackgroundColor: otherTheme.dialogBackgroundColor,
|
||||||
indicatorColor: otherTheme.indicatorColor,
|
indicatorColor: otherTheme.indicatorColor,
|
||||||
@ -476,7 +476,6 @@ void main() {
|
|||||||
outlinedButtonTheme: otherTheme.outlinedButtonTheme,
|
outlinedButtonTheme: otherTheme.outlinedButtonTheme,
|
||||||
textSelectionTheme: otherTheme.textSelectionTheme,
|
textSelectionTheme: otherTheme.textSelectionTheme,
|
||||||
fixTextFieldOutlineLabel: otherTheme.fixTextFieldOutlineLabel,
|
fixTextFieldOutlineLabel: otherTheme.fixTextFieldOutlineLabel,
|
||||||
useTextSelectionTheme: otherTheme.useTextSelectionTheme,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(themeDataCopy.brightness, equals(otherTheme.brightness));
|
expect(themeDataCopy.brightness, equals(otherTheme.brightness));
|
||||||
@ -505,11 +504,11 @@ void main() {
|
|||||||
expect(themeDataCopy.toggleButtonsTheme, equals(otherTheme.toggleButtonsTheme));
|
expect(themeDataCopy.toggleButtonsTheme, equals(otherTheme.toggleButtonsTheme));
|
||||||
expect(themeDataCopy.buttonColor, equals(otherTheme.buttonColor));
|
expect(themeDataCopy.buttonColor, equals(otherTheme.buttonColor));
|
||||||
expect(themeDataCopy.secondaryHeaderColor, equals(otherTheme.secondaryHeaderColor));
|
expect(themeDataCopy.secondaryHeaderColor, equals(otherTheme.secondaryHeaderColor));
|
||||||
expect(themeDataCopy.textSelectionColor, equals(otherTheme.textSelectionColor));
|
expect(themeDataCopy.textSelectionTheme.selectionColor, equals(otherTheme.textSelectionTheme.selectionColor));
|
||||||
expect(themeDataCopy.cursorColor, equals(otherTheme.cursorColor));
|
expect(themeDataCopy.textSelectionTheme.cursorColor, equals(otherTheme.textSelectionTheme.cursorColor));
|
||||||
expect(themeDataCopy.textSelectionColor, equals(otherTheme.textSelectionColor));
|
expect(themeDataCopy.textSelectionTheme.selectionColor, equals(otherTheme.textSelectionTheme.selectionColor));
|
||||||
expect(themeDataCopy.cursorColor, equals(otherTheme.cursorColor));
|
expect(themeDataCopy.textSelectionTheme.cursorColor, equals(otherTheme.textSelectionTheme.cursorColor));
|
||||||
expect(themeDataCopy.textSelectionHandleColor, equals(otherTheme.textSelectionHandleColor));
|
expect(themeDataCopy.textSelectionTheme.selectionHandleColor, equals(otherTheme.textSelectionTheme.selectionHandleColor));
|
||||||
expect(themeDataCopy.backgroundColor, equals(otherTheme.backgroundColor));
|
expect(themeDataCopy.backgroundColor, equals(otherTheme.backgroundColor));
|
||||||
expect(themeDataCopy.dialogBackgroundColor, equals(otherTheme.dialogBackgroundColor));
|
expect(themeDataCopy.dialogBackgroundColor, equals(otherTheme.dialogBackgroundColor));
|
||||||
expect(themeDataCopy.indicatorColor, equals(otherTheme.indicatorColor));
|
expect(themeDataCopy.indicatorColor, equals(otherTheme.indicatorColor));
|
||||||
@ -549,7 +548,6 @@ void main() {
|
|||||||
expect(themeDataCopy.outlinedButtonTheme, equals(otherTheme.outlinedButtonTheme));
|
expect(themeDataCopy.outlinedButtonTheme, equals(otherTheme.outlinedButtonTheme));
|
||||||
expect(themeDataCopy.textSelectionTheme, equals(otherTheme.textSelectionTheme));
|
expect(themeDataCopy.textSelectionTheme, equals(otherTheme.textSelectionTheme));
|
||||||
expect(themeDataCopy.fixTextFieldOutlineLabel, equals(otherTheme.fixTextFieldOutlineLabel));
|
expect(themeDataCopy.fixTextFieldOutlineLabel, equals(otherTheme.fixTextFieldOutlineLabel));
|
||||||
expect(themeDataCopy.useTextSelectionTheme, equals(otherTheme.useTextSelectionTheme));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('ThemeData.toString has less than 200 characters output', (WidgetTester tester) async {
|
testWidgets('ThemeData.toString has less than 200 characters output', (WidgetTester tester) async {
|
||||||
|
@ -101,7 +101,7 @@ void main() {
|
|||||||
|
|
||||||
test('test filtering formatter, deny mode (deprecated names)', () {
|
test('test filtering formatter, deny mode (deprecated names)', () {
|
||||||
final TextEditingValue actualValue =
|
final TextEditingValue actualValue =
|
||||||
BlacklistingTextInputFormatter(RegExp(r'[a-z]'))
|
FilteringTextInputFormatter.deny(RegExp(r'[a-z]'))
|
||||||
.formatEditUpdate(testOldValue, testNewValue);
|
.formatEditUpdate(testOldValue, testNewValue);
|
||||||
|
|
||||||
// Expecting
|
// Expecting
|
||||||
@ -134,7 +134,7 @@ void main() {
|
|||||||
|
|
||||||
test('test single line formatter (deprecated names)', () {
|
test('test single line formatter (deprecated names)', () {
|
||||||
final TextEditingValue actualValue =
|
final TextEditingValue actualValue =
|
||||||
BlacklistingTextInputFormatter.singleLineFormatter
|
FilteringTextInputFormatter.singleLineFormatter
|
||||||
.formatEditUpdate(testOldValue, testNewValue);
|
.formatEditUpdate(testOldValue, testNewValue);
|
||||||
|
|
||||||
// Expecting
|
// Expecting
|
||||||
@ -166,7 +166,7 @@ void main() {
|
|||||||
|
|
||||||
test('test filtering formatter, allow mode (deprecated names)', () {
|
test('test filtering formatter, allow mode (deprecated names)', () {
|
||||||
final TextEditingValue actualValue =
|
final TextEditingValue actualValue =
|
||||||
WhitelistingTextInputFormatter(RegExp(r'[a-c]'))
|
FilteringTextInputFormatter.allow(RegExp(r'[a-c]'))
|
||||||
.formatEditUpdate(testOldValue, testNewValue);
|
.formatEditUpdate(testOldValue, testNewValue);
|
||||||
|
|
||||||
// Expecting
|
// Expecting
|
||||||
@ -198,7 +198,7 @@ void main() {
|
|||||||
|
|
||||||
test('test digits only formatter (deprecated names)', () {
|
test('test digits only formatter (deprecated names)', () {
|
||||||
final TextEditingValue actualValue =
|
final TextEditingValue actualValue =
|
||||||
WhitelistingTextInputFormatter.digitsOnly
|
FilteringTextInputFormatter.digitsOnly
|
||||||
.formatEditUpdate(testOldValue, testNewValue);
|
.formatEditUpdate(testOldValue, testNewValue);
|
||||||
|
|
||||||
// Expecting
|
// Expecting
|
||||||
@ -528,7 +528,7 @@ void main() {
|
|||||||
const TextEditingValue oldValue = TextEditingValue(text: '12345');
|
const TextEditingValue oldValue = TextEditingValue(text: '12345');
|
||||||
const TextEditingValue newValue = TextEditingValue(text: '12345@');
|
const TextEditingValue newValue = TextEditingValue(text: '12345@');
|
||||||
|
|
||||||
final WhitelistingTextInputFormatter formatter = WhitelistingTextInputFormatter.digitsOnly;
|
final TextInputFormatter formatter = FilteringTextInputFormatter.digitsOnly;
|
||||||
final TextEditingValue formatted = formatter.formatEditUpdate(oldValue, newValue);
|
final TextEditingValue formatted = formatter.formatEditUpdate(oldValue, newValue);
|
||||||
|
|
||||||
// assert that we are passing digits only at the first time
|
// assert that we are passing digits only at the first time
|
||||||
@ -583,8 +583,8 @@ void main() {
|
|||||||
TextEditingValue oldValue = collapsedValue('123', 0);
|
TextEditingValue oldValue = collapsedValue('123', 0);
|
||||||
TextEditingValue newValue = collapsedValue('123456', 6);
|
TextEditingValue newValue = collapsedValue('123456', 6);
|
||||||
|
|
||||||
final WhitelistingTextInputFormatter formatter =
|
final TextInputFormatter formatter =
|
||||||
WhitelistingTextInputFormatter.digitsOnly;
|
FilteringTextInputFormatter.digitsOnly;
|
||||||
TextEditingValue formatted = formatter.formatEditUpdate(oldValue,
|
TextEditingValue formatted = formatter.formatEditUpdate(oldValue,
|
||||||
newValue);
|
newValue);
|
||||||
|
|
||||||
|
@ -453,7 +453,6 @@ void main() {
|
|||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
overflow: Overflow.visible,
|
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
children: const <Widget>[
|
children: const <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user