Writing Integration Tests
What aspect of integration testing is this code focusing on?
test('file upload integration', async () => {
const file = new File(['test content'], 'test.txt', {
type: 'text/plain'
});
const formData = new FormData();
formData.append('file', file);
const response = await request(app)
.post('/api/upload')
.attach('file', file)
.expect(200);
const storedFile = await storage.get(response.body.fileId);
expect(storedFile.content).toBe('test content');
});