@@ -48,13 +48,8 @@ describe('Tasks API', async () => {
4848 TEST_CHILD_USER . password
4949 )
5050
51- // Get the child user by username
5251 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
5352
54- if ( ! childUser ) {
55- throw new Error ( 'Child user not found in database' )
56- }
57-
5853 const response = await $fetch < TasksResponse > ( '/api/tasks' , {
5954 method : 'GET' ,
6055 headers : {
@@ -76,13 +71,8 @@ describe('Tasks API', async () => {
7671 TEST_PARENT_USER . password
7772 )
7873
79- // Get the child user by username
8074 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
8175
82- if ( ! childUser ) {
83- throw new Error ( 'Child user not found in database' )
84- }
85-
8676 const response = await $fetch < TasksResponse > ( '/api/tasks' , {
8777 method : 'GET' ,
8878 headers : {
@@ -104,13 +94,8 @@ describe('Tasks API', async () => {
10494 TEST_PARENT_USER . password
10595 )
10696
107- // Get the child user by username
10897 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
10998
110- if ( ! childUser ) {
111- throw new Error ( 'Child user not found in database' )
112- }
113-
11499 const response = await $fetch < TaskResponse > ( '/api/tasks' , {
115100 method : 'POST' ,
116101 body : {
@@ -195,13 +180,8 @@ describe('Tasks API', async () => {
195180 TEST_PARENT_USER . password
196181 )
197182
198- // First create a task to update
199183 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
200184
201- if ( ! childUser ) {
202- throw new Error ( 'Child user not found in database' )
203- }
204-
205185 const createResponse = await $fetch < TaskResponse > ( '/api/tasks' , {
206186 method : 'POST' ,
207187 body : {
@@ -270,13 +250,8 @@ describe('Tasks API', async () => {
270250 TEST_PARENT_USER . password
271251 )
272252
273- // First create a task to delete
274253 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
275254
276- if ( ! childUser ) {
277- throw new Error ( 'Child user not found in database' )
278- }
279-
280255 const createResponse = await $fetch < TaskResponse > ( '/api/tasks' , {
281256 method : 'POST' ,
282257 body : {
@@ -359,13 +334,8 @@ describe('Tasks API', async () => {
359334 TEST_PARENT_USER . password
360335 )
361336
362- // Get the child user by username
363337 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
364338
365- if ( ! childUser ) {
366- throw new Error ( 'Child user not found in database' )
367- }
368-
369339 // Create a task first
370340 const createResponse = await $fetch < TaskResponse > ( '/api/tasks' , {
371341 method : 'POST' ,
@@ -412,13 +382,8 @@ describe('Tasks API', async () => {
412382 TEST_PARENT_USER . password
413383 )
414384
415- // Get the child user by username
416385 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
417386
418- if ( ! childUser ) {
419- throw new Error ( 'Child user not found in database' )
420- }
421-
422387 // Create a task first
423388 const createResponse = await $fetch < TaskResponse > ( '/api/tasks' , {
424389 method : 'POST' ,
@@ -465,13 +430,8 @@ describe('Tasks API', async () => {
465430 TEST_PARENT_USER . password
466431 )
467432
468- // Get the child user by username
469433 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
470434
471- if ( ! childUser ) {
472- throw new Error ( 'Child user not found in database' )
473- }
474-
475435 // Create a task first
476436 const createResponse = await $fetch < TaskResponse > ( '/api/tasks' , {
477437 method : 'POST' ,
@@ -569,13 +529,8 @@ describe('Tasks API', async () => {
569529 TEST_PARENT_USER . password
570530 )
571531
572- // Get the child user by username
573532 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
574533
575- if ( ! childUser ) {
576- throw new Error ( 'Child user not found in database' )
577- }
578-
579534 // Create a task first
580535 const createResponse = await $fetch < TaskResponse > ( '/api/tasks' , {
581536 method : 'POST' ,
@@ -636,13 +591,8 @@ describe('Tasks API', async () => {
636591 TEST_PARENT_USER . password
637592 )
638593
639- // Get the child user by username
640594 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
641595
642- if ( ! childUser ) {
643- throw new Error ( 'Child user not found in database' )
644- }
645-
646596 // Create a task first
647597 const createResponse = await $fetch < TaskResponse > ( '/api/tasks' , {
648598 method : 'POST' ,
@@ -710,13 +660,8 @@ describe('Tasks API', async () => {
710660 TEST_PARENT_USER . password
711661 )
712662
713- // Get the child user by username
714663 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
715664
716- if ( ! childUser ) {
717- throw new Error ( 'Child user not found in database' )
718- }
719-
720665 // Create a task first
721666 const createResponse = await $fetch < TaskResponse > ( '/api/tasks' , {
722667 method : 'POST' ,
@@ -779,13 +724,8 @@ describe('Tasks API', async () => {
779724 TEST_PARENT_USER . password
780725 )
781726
782- // Get the child user by username
783727 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
784728
785- if ( ! childUser ) {
786- throw new Error ( 'Child user not found in database' )
787- }
788-
789729 // Create a task first
790730 const createResponse = await $fetch < TaskResponse > ( '/api/tasks' , {
791731 method : 'POST' ,
@@ -861,13 +801,8 @@ describe('Tasks API', async () => {
861801 TEST_PARENT_USER . password
862802 )
863803
864- // Get the child user by username
865804 const childUser = await getUserByUsername ( TEST_CHILD_USER . username )
866805
867- if ( ! childUser ) {
868- throw new Error ( 'Child user not found in database' )
869- }
870-
871806 // Create a perpetual task first
872807 const createResponse = await $fetch < TaskResponse > ( '/api/tasks' , {
873808 method : 'POST' ,
0 commit comments