Skip to content

Commit

Permalink
refactor: expand file tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dblythy committed Jan 12, 2025
1 parent 7534eb7 commit b6a4459
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/ParseFile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,26 @@ describe('Parse.File testing', () => {
expect(response.headers['content-type']).toMatch(/^text\/html/);
});

it('works without Content-Type and extension', async () => {
await reconfigureServer({
fileUpload: {
enableForPublic: true,
},
});
const headers = {
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'rest',
};
const result = await request({
method: 'POST',
headers: headers,
url: 'http://localhost:8378/1/files/file',
body: '<html></html>\n',
});
expect(result.data.url.includes('file.txt')).toBeTrue();
expect(result.data.name.includes('file.txt')).toBeTrue();
});

it('filename is url encoded', done => {
const headers = {
'Content-Type': 'text/html',
Expand Down

0 comments on commit b6a4459

Please sign in to comment.