(t *testing.T)
| 445 | } |
| 446 | |
| 447 | func TestUpdateNote(t *testing.T) { |
| 448 | updatedBody := "some updated content" |
| 449 | |
| 450 | b1UUID := "37868a8e-a844-4265-9a4f-0be598084733" |
| 451 | b2UUID := "8f3bd424-6aa5-4ed5-910d-e5b38ab09f8c" |
| 452 | |
| 453 | type payloadData struct { |
| 454 | Content *string `schema:"content" json:"content,omitempty"` |
| 455 | BookUUID *string `schema:"book_uuid" json:"book_uuid,omitempty"` |
| 456 | } |
| 457 | |
| 458 | testCases := []struct { |
| 459 | payload testutils.PayloadWrapper |
| 460 | noteUUID string |
| 461 | noteBookUUID string |
| 462 | noteBody string |
| 463 | noteDeleted bool |
| 464 | expectedNoteBody string |
| 465 | expectedNoteBookName string |
| 466 | expectedNoteBookUUID string |
| 467 | }{ |
| 468 | { |
| 469 | payload: testutils.PayloadWrapper{ |
| 470 | Data: payloadData{ |
| 471 | Content: &updatedBody, |
| 472 | }, |
| 473 | }, |
| 474 | noteUUID: "ab50aa32-b232-40d8-b10f-10a7f9134053", |
| 475 | noteBookUUID: b1UUID, |
| 476 | noteBody: "original content", |
| 477 | noteDeleted: false, |
| 478 | expectedNoteBookUUID: b1UUID, |
| 479 | expectedNoteBody: "some updated content", |
| 480 | expectedNoteBookName: "css", |
| 481 | }, |
| 482 | { |
| 483 | payload: testutils.PayloadWrapper{ |
| 484 | Data: payloadData{ |
| 485 | BookUUID: &b1UUID, |
| 486 | }, |
| 487 | }, |
| 488 | noteUUID: "ab50aa32-b232-40d8-b10f-10a7f9134053", |
| 489 | noteBookUUID: b1UUID, |
| 490 | noteBody: "original content", |
| 491 | noteDeleted: false, |
| 492 | expectedNoteBookUUID: b1UUID, |
| 493 | expectedNoteBody: "original content", |
| 494 | expectedNoteBookName: "css", |
| 495 | }, |
| 496 | { |
| 497 | payload: testutils.PayloadWrapper{ |
| 498 | Data: payloadData{ |
| 499 | BookUUID: &b2UUID, |
| 500 | }, |
| 501 | }, |
| 502 | noteUUID: "ab50aa32-b232-40d8-b10f-10a7f9134053", |
| 503 | noteBookUUID: b1UUID, |
| 504 | noteBody: "original content", |
nothing calls this directly
no test coverage detected