Commit b07b417
committed
test: fulfill email sendEmail TODO — assert emailProvider.sendEmail is called
The existing test had a TODO comment noting that it should assert
emailProvider.sendEmail was called but only verified no exceptions were thrown.
Now uses vi.spyOn to verify:
- emailProvider.sendEmail is called exactly once
- called with the correct recipient address
- called with an html body that includes the magic link URL
email-provider.server.ts already short-circuits in test mode (returns
Promise.resolve without hitting Mailgun), so no mocking of HTTP is needed.1 parent f2d2e4e commit b07b417
1 file changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
| 15 | + | |
| 16 | + | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
| |||
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
17 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
18 | 34 | | |
19 | 35 | | |
0 commit comments