-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add date-fns, remove moment, add tests to safeguard change
- Loading branch information
1 parent
7ed3116
commit ba23597
Showing
10 changed files
with
124 additions
and
47 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
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
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { mockSimplybookBodyBase } from 'test/utils/mockData'; | ||
import { formatTherapySessionObject } from './serialize'; | ||
|
||
describe('Serialize', () => { | ||
describe('formatTherapySessionObject', () => { | ||
it('should format object correctly when valid object is supplied', () => { | ||
const randomString = formatTherapySessionObject(mockSimplybookBodyBase, 'partnerAccessId'); | ||
expect(randomString).toEqual({ | ||
action: 'UPDATED_BOOKING', | ||
bookingCode: 'abc', | ||
cancelledAt: null, | ||
clientEmail: '[email protected]', | ||
clientTimezone: 'Europe/London', | ||
completedAt: null, | ||
endDateTime: new Date('2022-09-12T08:30:00+0000'), | ||
partnerAccessId: 'partnerAccessId', | ||
rescheduledFrom: null, | ||
serviceName: 'bloom therapy', | ||
serviceProviderEmail: '[email protected]', | ||
serviceProviderName: '[email protected]', | ||
startDateTime: new Date('2022-09-12T07:30:00+0000'), | ||
}); | ||
}); | ||
}); | ||
}); |
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
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
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
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
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
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 |
---|---|---|
|
@@ -326,6 +326,13 @@ | |
dependencies: | ||
"@babel/helper-plugin-utils" "^7.14.5" | ||
|
||
"@babel/runtime@^7.21.0": | ||
version "7.22.15" | ||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8" | ||
integrity sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA== | ||
dependencies: | ||
regenerator-runtime "^0.14.0" | ||
|
||
"@babel/template@^7.15.4", "@babel/template@^7.3.3": | ||
version "7.15.4" | ||
resolved "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz" | ||
|
@@ -2672,6 +2679,13 @@ date-and-time@^2.0.0: | |
resolved "https://registry.yarnpkg.com/date-and-time/-/date-and-time-2.0.1.tgz#bc8b72704980e8a0979bb186118d30d02059ef04" | ||
integrity sha512-O7Xe5dLaqvY/aF/MFWArsAM1J4j7w1CSZlPCX9uHgmb+6SbkPd8Q4YOvfvH/cZGvFlJFfHOZKxQtmMUOoZhc/w== | ||
|
||
date-fns@^2.30.0: | ||
version "2.30.0" | ||
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" | ||
integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw== | ||
dependencies: | ||
"@babel/runtime" "^7.21.0" | ||
|
||
[email protected]: | ||
version "2.6.9" | ||
resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" | ||
|
@@ -4949,11 +4963,6 @@ mkdirp@^1.0.4: | |
resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" | ||
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== | ||
|
||
moment@^2.29.4: | ||
version "2.29.4" | ||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" | ||
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== | ||
|
||
[email protected]: | ||
version "2.0.0" | ||
resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" | ||
|
@@ -5639,6 +5648,11 @@ reflect-metadata@^0.1.13: | |
resolved "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz" | ||
integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== | ||
|
||
regenerator-runtime@^0.14.0: | ||
version "0.14.0" | ||
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" | ||
integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== | ||
|
||
regexpp@^3.1.0: | ||
version "3.2.0" | ||
resolved "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz" | ||
|