Created
November 11, 2020 05:55
-
-
Save antklim/ccb022590b1f29dd88f6eb280b72b2bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
group('Calculus screen', () { | |
... | |
testWidgets('has one operand when operation is SQRT', (WidgetTester tester) async { | |
// initiate required state | |
CalculatorState state = CalculatorState(); | |
state.setOperation(Sqrt); | |
await tester.pumpWidget(MaterialApp( | |
home: ChangeNotifierProvider<CalculatorState>( | |
create: (_) => state, // passing state to widgtes | |
builder: (context, _) => CalculusScreenContainer(), | |
), | |
)); | |
expect(find.text('Operand A'), findsOneWidget); | |
expect(find.text('Operand B'), findsNothing); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment