expectLocked function
Assert that a named lock is currently held in a NyPage/NyState widget.
Uses finder to locate the widget and checks the lock named name.
Example:
expectLocked(tester, find.byType(MyPage), 'submit');
Implementation
void expectLocked(WidgetTester tester, Finder finder, String name) {
final state = _findNyBaseState(finder);
expect(
state.isLocked(name),
isTrue,
reason: 'Expected lock "$name" to be held',
);
}