Skip to content

Commit

Permalink
#108 - add test to loadTextBodyOfRequest with encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulKa committed Oct 31, 2024
1 parent 8864146 commit b251c1d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/persistence/service/persistence-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,24 @@ describe('PersistenceService', () => {
expect(await streamToString(result)).toBe(textBody);
});

it('loadTextBodyOfRequest() should load the text body of a request with utf8', async () => {
// Arrange
const textBody = 'text body';
const request = getExampleRequest(collection.id);
collection.children.push(request);

await persistenceService.saveCollectionRecursive(collection);
await persistenceService.saveRequest(request, textBody);

// Act
const result = (
await Array.fromAsync(await persistenceService.loadTextBodyOfRequest(request, 'utf8'))
).join('');

// Assert
expect(result).toBe(textBody);
});

it('loadTextBodyOfRequest() should load the text body of a draft request', async () => {
// Arrange
const textBody = 'text body';
Expand Down

0 comments on commit b251c1d

Please sign in to comment.