|
8 | 8 | Placeholders, |
9 | 9 | titleCase, |
10 | 10 | formatForClipboardWithNotes, |
| 11 | + parseNotesData, |
11 | 12 | } from "./writingStyle"; |
12 | | -import { INote } from "../entities/INote"; |
| 13 | +import { INote, NoteType } from "../entities/INote"; |
13 | 14 | import { formatDateTime } from "./dateTime"; |
14 | 15 |
|
15 | 16 | describe("titleCase()", () => { |
@@ -367,4 +368,49 @@ describe("formatForClipboard", () => { |
367 | 368 | "Versioning: 0\n", |
368 | 369 | ); |
369 | 370 | }); |
| 371 | + |
| 372 | + it("export notes is in the correct format", () => { |
| 373 | + const notes: INote[] = [ |
| 374 | + { |
| 375 | + id: "id", |
| 376 | + beaconId: "beaconId", |
| 377 | + text: "Label Generated", |
| 378 | + type: NoteType.RECORD_HISTORY, |
| 379 | + createdDate: "2020-02-06T00:00:00Z", |
| 380 | + userId: "userId", |
| 381 | + fullName: "SYSTEM", |
| 382 | + email: "", |
| 383 | + }, |
| 384 | + { |
| 385 | + id: "id", |
| 386 | + beaconId: "beaconId", |
| 387 | + text: "Beacon MMSI coded, assuming COSPAS SARSAT Type Approval 1351. Generate labels", |
| 388 | + type: NoteType.GENERAL, |
| 389 | + createdDate: "2026-02-06T00:00:00Z", |
| 390 | + userId: "userId", |
| 391 | + fullName: "Full Name", |
| 392 | + email: "example@emailaddress.com", |
| 393 | + }, |
| 394 | + ]; |
| 395 | + |
| 396 | + expect(formatForClipboard(parseNotesData(notes))).toEqual( |
| 397 | + "\n" + |
| 398 | + "=====NOTES=====\n" + |
| 399 | + "\n" + |
| 400 | + "-----NOTES (1)-----\n" + |
| 401 | + "Type Of Note: RECORD_HISTORY\n" + |
| 402 | + "Note: Label Generated\n" + |
| 403 | + "Noted By: SYSTEM\n" + |
| 404 | + "Noted By Email Address: N/A\n" + |
| 405 | + "Date: 06/02/2020\n" + |
| 406 | + ",\n" + |
| 407 | + "-----NOTES (2)-----\n" + |
| 408 | + "Type Of Note: GENERAL\n" + |
| 409 | + "Note: Beacon MMSI coded, assuming COSPAS SARSAT Type Approval 1351. Generate labels\n" + |
| 410 | + "Noted By: Full Name\n" + |
| 411 | + "Noted By Email Address: example@emailaddress.com\n" + |
| 412 | + "Date: 06/02/2026" + |
| 413 | + "\n", |
| 414 | + ); |
| 415 | + }); |
370 | 416 | }); |
0 commit comments