Skip to content

Commit 32ff0b1

Browse files
committed
style: format
1 parent 251c65f commit 32ff0b1

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

coverage/lcov.info

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
SF:lib/src/ht_email_repository.dart
1+
SF:lib\src\ht_email_repository.dart
22
DA:15,1
3-
DA:27,1
4-
DA:32,2
5-
DA:36,1
6-
LF:4
7-
LH:4
3+
DA:32,1
4+
DA:38,2
5+
DA:41,1
6+
DA:45,1
7+
LF:5
8+
LH:5
89
end_of_record

lib/src/ht_email_repository.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ class HtEmailRepository {
3838
await _emailClient.sendTransactionalEmail(
3939
recipientEmail: recipientEmail,
4040
templateId: templateId,
41-
templateData: {
42-
'otp_code': otpCode,
43-
},
41+
templateData: {'otp_code': otpCode},
4442
);
4543
} on HtHttpException {
4644
rethrow; // Propagate client-level exceptions

test/src/ht_email_repository_test.dart

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,35 @@ void main() {
2828

2929
group('sendOtpEmail', () {
3030
test(
31-
'calls sendTransactionalEmail on client with correct data successfully',
32-
() async {
33-
// Arrange
34-
when(
35-
() => mockEmailClient.sendTransactionalEmail(
36-
recipientEmail: any(named: 'recipientEmail'),
37-
templateId: any(named: 'templateId'),
38-
templateData: any(named: 'templateData'),
39-
),
40-
).thenAnswer((_) async {}); // Simulate successful void return
41-
42-
// Act
43-
await emailRepository.sendOtpEmail(
44-
recipientEmail: testEmail,
45-
otpCode: testOtpCode,
46-
templateId: testTemplateId,
47-
);
31+
'calls sendTransactionalEmail on client with correct data successfully',
32+
() async {
33+
// Arrange
34+
when(
35+
() => mockEmailClient.sendTransactionalEmail(
36+
recipientEmail: any(named: 'recipientEmail'),
37+
templateId: any(named: 'templateId'),
38+
templateData: any(named: 'templateData'),
39+
),
40+
).thenAnswer((_) async {}); // Simulate successful void return
4841

49-
// Assert
50-
verify(
51-
() => mockEmailClient.sendTransactionalEmail(
42+
// Act
43+
await emailRepository.sendOtpEmail(
5244
recipientEmail: testEmail,
45+
otpCode: testOtpCode,
5346
templateId: testTemplateId,
54-
templateData: {'otp_code': testOtpCode},
55-
),
56-
).called(1);
57-
verifyNoMoreInteractions(mockEmailClient);
58-
});
47+
);
48+
49+
// Assert
50+
verify(
51+
() => mockEmailClient.sendTransactionalEmail(
52+
recipientEmail: testEmail,
53+
templateId: testTemplateId,
54+
templateData: {'otp_code': testOtpCode},
55+
),
56+
).called(1);
57+
verifyNoMoreInteractions(mockEmailClient);
58+
},
59+
);
5960

6061
test('propagates HtHttpException from client', () async {
6162
// Arrange

0 commit comments

Comments
 (0)