-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed form mapper error where File objects were not being mapped corr…
…ectly (#448) * Fixed form mapper error where File objects were not being mapped correctly Will now rely on `FormData` methods for catching erroneous objects being passed in - it may be worth working towards a more robust mapper for future use, but for now, it is felt that this version is more than suitable for our needs. * Removed log statement Missed a log statement that is no longer required - this has been removed
- Loading branch information
1 parent
c5c9599
commit bbbc201
Showing
2 changed files
with
1 addition
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,27 +14,6 @@ describe("Basic formdata mapper tests", () => { | |
expect(formdataMapper(data)).toEqual(formData); | ||
}); | ||
|
||
it("should map a nested object", () => { | ||
const data = { | ||
name: "John Doe", | ||
age: 30, | ||
email: "[email protected]", | ||
address: { | ||
street: "1234 Elm St", | ||
city: "Springfield", | ||
state: "IL" | ||
} | ||
}; | ||
const formData = new FormData(); | ||
formData.append("name", "John Doe"); | ||
formData.append("age", "30"); | ||
formData.append("email", "[email protected]"); | ||
formData.append("address_street", "1234 Elm St"); | ||
formData.append("address_city", "Springfield"); | ||
formData.append("address_state", "IL"); | ||
expect(formdataMapper(data)).toEqual(formData); | ||
}); | ||
|
||
it("should throw an error for nested objects deeper than one layer", () => { | ||
const data = { | ||
name: "John Doe", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters