Skip to content
Permalink
Browse files

[TextFields] Add Outlined text area snapshot tests. (#6145)

Adding different snapshot tests for Outlined text areas.
    
 Part of #5762
  • Loading branch information
romoore committed Jan 2, 2019
1 parent 9651696 commit 4f54ed4f9288f44d80341eb424c8c98bca944330
Showing with 530 additions and 0 deletions.
  1. +66 −0 .../tests/snapshot/MDCTextFieldOutlinedTextAreaControllerBaselineCharacterCountArabicSnapshotTests.m
  2. +58 −0 ...s/tests/snapshot/MDCTextFieldOutlinedTextAreaControllerBaselineCharacterCountHindiSnapshotTests.m
  3. +55 −0 ...Fields/tests/snapshot/MDCTextFieldOutlinedTextAreaControllerBaselineCharacterCountSnapshotTests.m
  4. +3 −0 ...extAreaControllerBaselineCharacterCountArabicSnapshotTests/testTextFieldEmptyDisabled_11_2@2x.png
  5. +3 −0 ...xtAreaControllerBaselineCharacterCountArabicSnapshotTests/testTextFieldEmptyIsEditing_11_2@2x.png
  6. +3 −0 ...utlinedTextAreaControllerBaselineCharacterCountArabicSnapshotTests/testTextFieldEmpty_11_2@2x.png
  7. +3 −0 ...ollerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithLongErrorTextDisabled_11_2@2x.png
  8. +3 −0 ...llerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithLongErrorTextIsEditing_11_2@2x.png
  9. +3 −0 ...reaControllerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithLongErrorText_11_2@2x.png
  10. +3 −0 ...llerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithLongHelperTextDisabled_11_2@2x.png
  11. +3 −0 ...lerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithLongHelperTextIsEditing_11_2@2x.png
  12. +3 −0 ...eaControllerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithLongHelperText_11_2@2x.png
  13. +3 −0 ...acterCountArabicSnapshotTests/testTextFieldWithLongInputPlaceholderErrorTextsDisabled_11_2@2x.png
  14. +3 −0 ...cterCountArabicSnapshotTests/testTextFieldWithLongInputPlaceholderErrorTextsIsEditing_11_2@2x.png
  15. +3 −0 ...lineCharacterCountArabicSnapshotTests/testTextFieldWithLongInputPlaceholderErrorTexts_11_2@2x.png
  16. +3 −0 ...cterCountArabicSnapshotTests/testTextFieldWithLongInputPlaceholderHelperTextsDisabled_11_2@2x.png
  17. +3 −0 ...terCountArabicSnapshotTests/testTextFieldWithLongInputPlaceholderHelperTextsIsEditing_11_2@2x.png
  18. +3 −0 ...ineCharacterCountArabicSnapshotTests/testTextFieldWithLongInputPlaceholderHelperTexts_11_2@2x.png
  19. +3 −0 ...ollerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithLongInputTextDisabled_11_2@2x.png
  20. +3 −0 ...llerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithLongInputTextIsEditing_11_2@2x.png
  21. +3 −0 ...reaControllerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithLongInputText_11_2@2x.png
  22. +3 −0 ...aselineCharacterCountArabicSnapshotTests/testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png
  23. +3 −0 ...selineCharacterCountArabicSnapshotTests/testTextFieldWithLongPlaceholderTextIsEditing_11_2@2x.png
  24. +3 −0 ...trollerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png
  25. +3 −0 ...llerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithShortErrorTextDisabled_11_2@2x.png
  26. +3 −0 ...lerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithShortErrorTextIsEditing_11_2@2x.png
  27. +3 −0 ...eaControllerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithShortErrorText_11_2@2x.png
  28. +3 −0 ...lerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithShortHelperTextDisabled_11_2@2x.png
  29. +3 −0 ...erBaselineCharacterCountArabicSnapshotTests/testTextFieldWithShortHelperTextIsEditing_11_2@2x.png
  30. +3 −0 ...aControllerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithShortHelperText_11_2@2x.png
  31. +3 −0 ...cterCountArabicSnapshotTests/testTextFieldWithShortInputPlaceholderErrorTextsDisabled_11_2@2x.png
  32. +3 −0 ...terCountArabicSnapshotTests/testTextFieldWithShortInputPlaceholderErrorTextsIsEditing_11_2@2x.png
  33. +3 −0 ...ineCharacterCountArabicSnapshotTests/testTextFieldWithShortInputPlaceholderErrorTexts_11_2@2x.png
  34. +3 −0 ...terCountArabicSnapshotTests/testTextFieldWithShortInputPlaceholderHelperTextsDisabled_11_2@2x.png
  35. +3 −0 ...erCountArabicSnapshotTests/testTextFieldWithShortInputPlaceholderHelperTextsIsEditing_11_2@2x.png
  36. +3 −0 ...neCharacterCountArabicSnapshotTests/testTextFieldWithShortInputPlaceholderHelperTexts_11_2@2x.png
  37. +3 −0 ...llerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithShortInputTextDisabled_11_2@2x.png
  38. +3 −0 ...lerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithShortInputTextIsEditing_11_2@2x.png
  39. +3 −0 ...eaControllerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithShortInputText_11_2@2x.png
  40. +3 −0 ...selineCharacterCountArabicSnapshotTests/testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png
  41. +3 −0 ...elineCharacterCountArabicSnapshotTests/testTextFieldWithShortPlaceholderTextIsEditing_11_2@2x.png
  42. +3 −0 ...rollerBaselineCharacterCountArabicSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png
  43. +3 −0 ...TextAreaControllerBaselineCharacterCountHindiSnapshotTests/testTextFieldEmptyDisabled_11_2@2x.png
  44. +3 −0 ...extAreaControllerBaselineCharacterCountHindiSnapshotTests/testTextFieldEmptyIsEditing_11_2@2x.png
  45. +3 −0 ...OutlinedTextAreaControllerBaselineCharacterCountHindiSnapshotTests/testTextFieldEmpty_11_2@2x.png
  46. +3 −0 ...rollerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithLongErrorTextDisabled_11_2@2x.png
  47. +3 −0 ...ollerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithLongErrorTextIsEditing_11_2@2x.png
  48. +3 −0 ...AreaControllerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithLongErrorText_11_2@2x.png
  49. +3 −0 ...ollerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithLongHelperTextDisabled_11_2@2x.png
  50. +3 −0 ...llerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithLongHelperTextIsEditing_11_2@2x.png
  51. +3 −0 ...reaControllerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithLongHelperText_11_2@2x.png
  52. +3 −0 ...racterCountHindiSnapshotTests/testTextFieldWithLongInputPlaceholderErrorTextsDisabled_11_2@2x.png
  53. +3 −0 ...acterCountHindiSnapshotTests/testTextFieldWithLongInputPlaceholderErrorTextsIsEditing_11_2@2x.png
  54. +3 −0 ...elineCharacterCountHindiSnapshotTests/testTextFieldWithLongInputPlaceholderErrorTexts_11_2@2x.png
  55. +3 −0 ...acterCountHindiSnapshotTests/testTextFieldWithLongInputPlaceholderHelperTextsDisabled_11_2@2x.png
  56. +3 −0 ...cterCountHindiSnapshotTests/testTextFieldWithLongInputPlaceholderHelperTextsIsEditing_11_2@2x.png
  57. +3 −0 ...lineCharacterCountHindiSnapshotTests/testTextFieldWithLongInputPlaceholderHelperTexts_11_2@2x.png
  58. +3 −0 ...rollerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithLongInputTextDisabled_11_2@2x.png
  59. +3 −0 ...ollerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithLongInputTextIsEditing_11_2@2x.png
  60. +3 −0 ...AreaControllerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithLongInputText_11_2@2x.png
  61. +3 −0 ...BaselineCharacterCountHindiSnapshotTests/testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png
  62. +3 −0 ...aselineCharacterCountHindiSnapshotTests/testTextFieldWithLongPlaceholderTextIsEditing_11_2@2x.png
  63. +3 −0 ...ntrollerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png
  64. +3 −0 ...ollerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithShortErrorTextDisabled_11_2@2x.png
  65. +3 −0 ...llerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithShortErrorTextIsEditing_11_2@2x.png
  66. +3 −0 ...reaControllerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithShortErrorText_11_2@2x.png
  67. +3 −0 ...llerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithShortHelperTextDisabled_11_2@2x.png
  68. +3 −0 ...lerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithShortHelperTextIsEditing_11_2@2x.png
  69. +3 −0 ...eaControllerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithShortHelperText_11_2@2x.png
  70. +3 −0 ...acterCountHindiSnapshotTests/testTextFieldWithShortInputPlaceholderErrorTextsDisabled_11_2@2x.png
  71. +3 −0 ...cterCountHindiSnapshotTests/testTextFieldWithShortInputPlaceholderErrorTextsIsEditing_11_2@2x.png
  72. +3 −0 ...lineCharacterCountHindiSnapshotTests/testTextFieldWithShortInputPlaceholderErrorTexts_11_2@2x.png
  73. +3 −0 ...cterCountHindiSnapshotTests/testTextFieldWithShortInputPlaceholderHelperTextsDisabled_11_2@2x.png
  74. +3 −0 ...terCountHindiSnapshotTests/testTextFieldWithShortInputPlaceholderHelperTextsIsEditing_11_2@2x.png
  75. +3 −0 ...ineCharacterCountHindiSnapshotTests/testTextFieldWithShortInputPlaceholderHelperTexts_11_2@2x.png
  76. +3 −0 ...ollerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithShortInputTextDisabled_11_2@2x.png
  77. +3 −0 ...llerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithShortInputTextIsEditing_11_2@2x.png
  78. +3 −0 ...reaControllerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithShortInputText_11_2@2x.png
  79. +3 −0 ...aselineCharacterCountHindiSnapshotTests/testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png
  80. +3 −0 ...selineCharacterCountHindiSnapshotTests/testTextFieldWithShortPlaceholderTextIsEditing_11_2@2x.png
  81. +3 −0 ...trollerBaselineCharacterCountHindiSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png
  82. +3 −0 ...linedTextAreaControllerBaselineCharacterCountSnapshotTests/testTextFieldEmptyDisabled_11_2@2x.png
  83. +3 −0 ...inedTextAreaControllerBaselineCharacterCountSnapshotTests/testTextFieldEmptyIsEditing_11_2@2x.png
  84. +3 −0 ...FieldOutlinedTextAreaControllerBaselineCharacterCountSnapshotTests/testTextFieldEmpty_11_2@2x.png
  85. +3 −0 ...aControllerBaselineCharacterCountSnapshotTests/testTextFieldWithLongErrorTextDisabled_11_2@2x.png
  86. +3 −0 ...ControllerBaselineCharacterCountSnapshotTests/testTextFieldWithLongErrorTextIsEditing_11_2@2x.png
  87. +3 −0 ...dTextAreaControllerBaselineCharacterCountSnapshotTests/testTextFieldWithLongErrorText_11_2@2x.png
  88. +3 −0 ...ControllerBaselineCharacterCountSnapshotTests/testTextFieldWithLongHelperTextDisabled_11_2@2x.png
  89. +3 −0 ...ontrollerBaselineCharacterCountSnapshotTests/testTextFieldWithLongHelperTextIsEditing_11_2@2x.png
  90. +3 −0 ...TextAreaControllerBaselineCharacterCountSnapshotTests/testTextFieldWithLongHelperText_11_2@2x.png
  91. +3 −0 ...neCharacterCountSnapshotTests/testTextFieldWithLongInputPlaceholderErrorTextsDisabled_11_2@2x.png
  92. +3 −0 ...eCharacterCountSnapshotTests/testTextFieldWithLongInputPlaceholderErrorTextsIsEditing_11_2@2x.png
  93. +3 −0 ...erBaselineCharacterCountSnapshotTests/testTextFieldWithLongInputPlaceholderErrorTexts_11_2@2x.png
  94. +3 −0 ...eCharacterCountSnapshotTests/testTextFieldWithLongInputPlaceholderHelperTextsDisabled_11_2@2x.png
  95. +3 −0 ...CharacterCountSnapshotTests/testTextFieldWithLongInputPlaceholderHelperTextsIsEditing_11_2@2x.png
  96. +3 −0 ...rBaselineCharacterCountSnapshotTests/testTextFieldWithLongInputPlaceholderHelperTexts_11_2@2x.png
  97. +3 −0 ...aControllerBaselineCharacterCountSnapshotTests/testTextFieldWithLongInputTextDisabled_11_2@2x.png
  98. +3 −0 ...ControllerBaselineCharacterCountSnapshotTests/testTextFieldWithLongInputTextIsEditing_11_2@2x.png
  99. +3 −0 ...dTextAreaControllerBaselineCharacterCountSnapshotTests/testTextFieldWithLongInputText_11_2@2x.png
  100. +3 −0 ...ollerBaselineCharacterCountSnapshotTests/testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png
  101. +3 −0 ...llerBaselineCharacterCountSnapshotTests/testTextFieldWithLongPlaceholderTextIsEditing_11_2@2x.png
  102. +3 −0 ...reaControllerBaselineCharacterCountSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png
  103. +3 −0 ...ControllerBaselineCharacterCountSnapshotTests/testTextFieldWithShortErrorTextDisabled_11_2@2x.png
  104. +3 −0 ...ontrollerBaselineCharacterCountSnapshotTests/testTextFieldWithShortErrorTextIsEditing_11_2@2x.png
  105. +3 −0 ...TextAreaControllerBaselineCharacterCountSnapshotTests/testTextFieldWithShortErrorText_11_2@2x.png
  106. +3 −0 ...ontrollerBaselineCharacterCountSnapshotTests/testTextFieldWithShortHelperTextDisabled_11_2@2x.png
  107. +3 −0 ...ntrollerBaselineCharacterCountSnapshotTests/testTextFieldWithShortHelperTextIsEditing_11_2@2x.png
  108. +3 −0 ...extAreaControllerBaselineCharacterCountSnapshotTests/testTextFieldWithShortHelperText_11_2@2x.png
  109. +3 −0 ...eCharacterCountSnapshotTests/testTextFieldWithShortInputPlaceholderErrorTextsDisabled_11_2@2x.png
  110. +3 −0 ...CharacterCountSnapshotTests/testTextFieldWithShortInputPlaceholderErrorTextsIsEditing_11_2@2x.png
  111. +3 −0 ...rBaselineCharacterCountSnapshotTests/testTextFieldWithShortInputPlaceholderErrorTexts_11_2@2x.png
  112. +3 −0 ...CharacterCountSnapshotTests/testTextFieldWithShortInputPlaceholderHelperTextsDisabled_11_2@2x.png
  113. +3 −0 ...haracterCountSnapshotTests/testTextFieldWithShortInputPlaceholderHelperTextsIsEditing_11_2@2x.png
  114. +3 −0 ...BaselineCharacterCountSnapshotTests/testTextFieldWithShortInputPlaceholderHelperTexts_11_2@2x.png
  115. +3 −0 ...ControllerBaselineCharacterCountSnapshotTests/testTextFieldWithShortInputTextDisabled_11_2@2x.png
  116. +3 −0 ...ontrollerBaselineCharacterCountSnapshotTests/testTextFieldWithShortInputTextIsEditing_11_2@2x.png
  117. +3 −0 ...TextAreaControllerBaselineCharacterCountSnapshotTests/testTextFieldWithShortInputText_11_2@2x.png
  118. +3 −0 ...llerBaselineCharacterCountSnapshotTests/testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png
  119. +3 −0 ...lerBaselineCharacterCountSnapshotTests/testTextFieldWithShortPlaceholderTextIsEditing_11_2@2x.png
  120. +3 −0 ...eaControllerBaselineCharacterCountSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png
@@ -0,0 +1,66 @@
// Copyright 2018-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#import "MDCAbstractTextFieldSnapshotTests+I18N.h"
#import "MDCAbstractTextFieldSnapshotTests.h"
#import "MaterialTextFields+ColorThemer.h"
#import "MaterialTextFields+TypographyThemer.h"
#import "MaterialTextFields.h"
#import "SnapshotFakeMDCMultilineTextField.h"

@interface MDCTextFieldOutlinedTextAreaControllerBaselineCharacterCountArabicSnapshotTests
: MDCAbstractTextFieldSnapshotTests <MDCTextFieldSnapshotTestCaseHooking>
@end

@implementation MDCTextFieldOutlinedTextAreaControllerBaselineCharacterCountArabicSnapshotTests

- (void)setUp {
[super setUp];

// Uncomment below to recreate the golden images for all test methods. Add it to a test method to
// update only that golden image.
// self.recordMode = YES;

self.textField = [[SnapshotFakeMDCMultilineTextField alloc] init];
self.textField.clearButtonMode = UITextFieldViewModeAlways;

self.textFieldController =
[[MDCTextInputControllerOutlinedTextArea alloc] initWithTextInput:self.textField];
self.textFieldController.characterCountMax = 50;
self.textFieldController.characterCountViewMode = UITextFieldViewModeAlways;
MDCSemanticColorScheme *colorScheme =
[[MDCSemanticColorScheme alloc] initWithDefaults:MDCColorSchemeDefaultsMaterial201804];
MDCTypographyScheme *typographyScheme =
[[MDCTypographyScheme alloc] initWithDefaults:MDCTypographySchemeDefaultsMaterial201804];

[MDCOutlinedTextFieldColorThemer applySemanticColorScheme:colorScheme
toTextInputController:self.textFieldController];
[MDCTextFieldTypographyThemer applyTypographyScheme:typographyScheme
toTextInputController:self.textFieldController];
[MDCTextFieldTypographyThemer applyTypographyScheme:typographyScheme toTextInput:self.textField];

[self changeStringsToArabic];
}

- (void)beforeGenerateSnapshotAndVerify {
if (@available(iOS 9.0, *)) {
[self changeLayoutToRTL];
} else {
NSLog(@"[ERROR] RTL tests can only run on iOS 9 or later.");
}
}

// NOTE: Additional test methods can be found in MDCAbstractTextFieldSnapshotTests.m

@end
@@ -0,0 +1,58 @@
// Copyright 2018-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#import "MDCAbstractTextFieldSnapshotTests+I18N.h"
#import "MDCAbstractTextFieldSnapshotTests.h"
#import "MaterialTextFields+ColorThemer.h"
#import "MaterialTextFields+TypographyThemer.h"
#import "MaterialTextFields.h"
#import "SnapshotFakeMDCMultilineTextField.h"

@interface MDCTextFieldOutlinedTextAreaControllerBaselineCharacterCountHindiSnapshotTests
: MDCAbstractTextFieldSnapshotTests
@end

@implementation MDCTextFieldOutlinedTextAreaControllerBaselineCharacterCountHindiSnapshotTests

- (void)setUp {
[super setUp];

// Uncomment below to recreate the golden images for all test methods. Add it to a test method to
// update only that golden image.
// self.recordMode = YES;

self.textField = [[SnapshotFakeMDCMultilineTextField alloc] init];
self.textField.clearButtonMode = UITextFieldViewModeAlways;

self.textFieldController =
[[MDCTextInputControllerOutlinedTextArea alloc] initWithTextInput:self.textField];
self.textFieldController.characterCountMax = 50;
self.textFieldController.characterCountViewMode = UITextFieldViewModeAlways;
MDCSemanticColorScheme *colorScheme =
[[MDCSemanticColorScheme alloc] initWithDefaults:MDCColorSchemeDefaultsMaterial201804];
MDCTypographyScheme *typographyScheme =
[[MDCTypographyScheme alloc] initWithDefaults:MDCTypographySchemeDefaultsMaterial201804];

[MDCOutlinedTextFieldColorThemer applySemanticColorScheme:colorScheme
toTextInputController:self.textFieldController];
[MDCTextFieldTypographyThemer applyTypographyScheme:typographyScheme
toTextInputController:self.textFieldController];
[MDCTextFieldTypographyThemer applyTypographyScheme:typographyScheme toTextInput:self.textField];

[self changeStringsToHindi];
}

// NOTE: Additional test methods can be found in MDCAbstractTextFieldSnapshotTests.m

@end
@@ -0,0 +1,55 @@
// Copyright 2018-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#import "MDCAbstractTextFieldSnapshotTests.h"
#import "MaterialTextFields+ColorThemer.h"
#import "MaterialTextFields+TypographyThemer.h"
#import "MaterialTextFields.h"
#import "SnapshotFakeMDCMultilineTextField.h"

@interface MDCTextFieldOutlinedTextAreaControllerBaselineCharacterCountSnapshotTests
: MDCAbstractTextFieldSnapshotTests
@end

@implementation MDCTextFieldOutlinedTextAreaControllerBaselineCharacterCountSnapshotTests

- (void)setUp {
[super setUp];

// Uncomment below to recreate the golden images for all test methods. Add it to a test method to
// update only that golden image.
// self.recordMode = YES;

self.textField = [[SnapshotFakeMDCMultilineTextField alloc] init];
self.textField.clearButtonMode = UITextFieldViewModeAlways;

self.textFieldController =
[[MDCTextInputControllerOutlinedTextArea alloc] initWithTextInput:self.textField];
self.textFieldController.characterCountMax = 50;
self.textFieldController.characterCountViewMode = UITextFieldViewModeAlways;
MDCSemanticColorScheme *colorScheme =
[[MDCSemanticColorScheme alloc] initWithDefaults:MDCColorSchemeDefaultsMaterial201804];
MDCTypographyScheme *typographyScheme =
[[MDCTypographyScheme alloc] initWithDefaults:MDCTypographySchemeDefaultsMaterial201804];

[MDCOutlinedTextFieldColorThemer applySemanticColorScheme:colorScheme
toTextInputController:self.textFieldController];
[MDCTextFieldTypographyThemer applyTypographyScheme:typographyScheme
toTextInputController:self.textFieldController];
[MDCTextFieldTypographyThemer applyTypographyScheme:typographyScheme toTextInput:self.textField];
}

// NOTE: Additional test methods can be found in MDCAbstractTextFieldSnapshotTests.m

@end

0 comments on commit 4f54ed4

Please sign in to comment.
You can’t perform that action at this time.