Skip to content

Commit ed544a7

Browse files
committed
profile test [nfc]: Rename group about custom fields; pull out some tests
Most of the tests in this group are about custom profile fields. Pull out the two that aren't, and rename the group.
1 parent 428e97e commit ed544a7

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/widgets/profile_test.dart

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,24 @@ CustomProfileField mkCustomProfileField(
7979
void main() {
8080
TestZulipBinding.ensureInitialized();
8181

82-
group('ProfilePage', () {
83-
testWidgets('page builds; profile page renders', (tester) async {
84-
final user = eg.user(userId: 1, fullName: 'test user',
85-
deliveryEmail: '[email protected]');
82+
testWidgets('page builds; profile page renders', (tester) async {
83+
final user = eg.user(userId: 1, fullName: 'test user',
84+
deliveryEmail: '[email protected]');
8685

87-
await setupPage(tester, users: [user], pageUserId: user.userId);
86+
await setupPage(tester, users: [user], pageUserId: user.userId);
8887

89-
check(because: 'find user avatar', find.byType(Avatar).evaluate()).length.equals(1);
90-
check(because: 'find user name', find.text('test user').evaluate()).isNotEmpty();
91-
check(because: 'find user delivery email', find.text('[email protected]').evaluate()).isNotEmpty();
92-
});
88+
check(because: 'find user avatar', find.byType(Avatar).evaluate()).length.equals(1);
89+
check(because: 'find user name', find.text('test user').evaluate()).isNotEmpty();
90+
check(because: 'find user delivery email', find.text('[email protected]').evaluate()).isNotEmpty();
91+
});
9392

93+
testWidgets('page builds; error page shows up if data is missing', (tester) async {
94+
await setupPage(tester, pageUserId: eg.selfUser.userId + 1989);
95+
check(because: 'find no user avatar', find.byType(Avatar).evaluate()).isEmpty();
96+
check(because: 'find error icon', find.byIcon(Icons.error).evaluate()).isNotEmpty();
97+
});
98+
99+
group('custom profile fields', () {
94100
testWidgets('page builds; profile page renders with profileData', (tester) async {
95101
await setupPage(tester,
96102
users: [
@@ -153,12 +159,6 @@ void main() {
153159
.deepEquals([1, 2]);
154160
});
155161

156-
testWidgets('page builds; error page shows up if data is missing', (tester) async {
157-
await setupPage(tester, pageUserId: eg.selfUser.userId + 1989);
158-
check(because: 'find no user avatar', find.byType(Avatar).evaluate()).isEmpty();
159-
check(because: 'find error icon', find.byIcon(Icons.error).evaluate()).isNotEmpty();
160-
});
161-
162162
testWidgets('page builds; link type will navigate', (tester) async {
163163
const testUrl = 'http://example/url';
164164
final user = eg.user(userId: 1, profileData: {

0 commit comments

Comments
 (0)