1
1
import request from "supertest" ;
2
- import type {
3
- Answers ,
4
- Answers_v1 ,
5
- } from "@core/types/waitlist/waitlist.answer.types" ;
2
+ import type { Answers_v1 } from "@core/types/waitlist/waitlist.answer.types" ;
6
3
7
4
describe ( "POST /api/waitlist" , ( ) => {
8
5
beforeEach ( ( ) => jest . resetModules ( ) ) ;
@@ -41,12 +38,13 @@ describe("POST /api/waitlist", () => {
41
38
app . post ( "/api/waitlist" , WaitlistController . addToWaitlist ) ;
42
39
43
40
const answers : Answers_v1 = {
41
+
42
+ schemaVersion : "1" ,
44
43
source : "social-media" ,
45
44
firstName : "Jo" ,
46
45
lastName : "Schmo" ,
47
-
46
+ profession : "Founder " ,
48
47
currentlyPayingFor : [ ] ,
49
- schemaVersion : "1" ,
50
48
anythingElse : "I'm a test" ,
51
49
} ;
52
50
const res = await request ( app ) . post ( "/api/waitlist" ) . send ( answers ) ;
@@ -66,16 +64,14 @@ describe("POST /api/waitlist", () => {
66
64
app . use ( express . json ( ) ) ;
67
65
app . post ( "/api/waitlist" , WaitlistController . addToWaitlist ) ;
68
66
69
- const answers : Answers = {
67
+ const answers : Answers_v1 = {
68
+
69
+ schemaVersion : "1" ,
70
70
source : "other" ,
71
71
firstName : "Jo" ,
72
72
lastName : "Schmo" ,
73
-
74
73
currentlyPayingFor : [ ] ,
75
- howClearAboutValues : "not-clear" ,
76
- workingTowardsMainGoal : "yes" ,
77
- isWillingToShare : false ,
78
- schemaVersion : "0" ,
74
+ profession : "Founder" ,
79
75
} ;
80
76
const res = await request ( app ) . post ( "/api/waitlist" ) . send ( answers ) ;
81
77
expect ( res . status ) . toBe ( 500 ) ;
0 commit comments