Skip to content

Commit

Permalink
Update Jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DMalone87 committed Oct 14, 2024
1 parent 3f98b9d commit d6fe459
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ services:
ports:
- "7475:7474"
- "7688:7687"
volumes:
- ./testdb-init:/docker-entrypoint-initdb.d
web:
build:
context: ./frontend
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/register/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function ViewerRegistration() {
function existingAccount(e?: AxiosError) {
return (
e.response?.status === 409 &&
e.response?.data?.message?.match(/Email matches existing account/i)
e.response?.data?.message?.match(/Error. Email matches existing account./i)
)
}

Expand Down
6 changes: 3 additions & 3 deletions frontend/tests/snapshots/__snapshots__/forgot.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ exports[`renders Forgot correctly 1`] = `
class="hidden defaultInputContainer inputContainer undefined"
>
<label
for="phoneNumberInput"
for="Phone NumberInput"
>
Phone Number:
</label>
<input
aria-invalid="false"
aria-required="true"
class="inputField"
id="phoneNumberInput"
name="phoneNumber"
id="Phone NumberInput"
name="Phone Number"
type="tel"
value=""
/>
Expand Down
18 changes: 9 additions & 9 deletions frontend/tests/snapshots/__snapshots__/register.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ exports[`renders Register correctly 1`] = `
class="defaultInputContainer inputContainer undefined"
>
<label
for="firstNameInput"
for="First NameInput"
>
First Name:
</label>
<input
aria-invalid="false"
aria-required="true"
class="inputField"
id="firstNameInput"
name="firstName"
id="First NameInput"
name="First Name"
type="text"
value=""
/>
Expand All @@ -72,16 +72,16 @@ exports[`renders Register correctly 1`] = `
class="defaultInputContainer inputContainer undefined"
>
<label
for="lastNameInput"
for="Last NameInput"
>
Last Name:
</label>
<input
aria-invalid="false"
aria-required="true"
class="inputField"
id="lastNameInput"
name="lastName"
id="Last NameInput"
name="Last Name"
type="text"
value=""
/>
Expand Down Expand Up @@ -112,16 +112,16 @@ exports[`renders Register correctly 1`] = `
class="defaultInputContainer inputContainer undefined"
>
<label
for="phoneNumberInput"
for="Phone NumberInput"
>
Phone Number:
</label>
<input
aria-invalid="false"
aria-required="true"
class="inputField"
id="phoneNumberInput"
name="phoneNumber"
id="Phone NumberInput"
name="Phone Number"
type="tel"
value=""
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ exports[`the map renders Map correctly 1`] = `
<path
class="state"
cursor="pointer"
d="M752.3425752737927,279.8240119357407L763.9434120663782,277.54050331680196L797.6361900483978,273.9160284725982L797.8092480208237,275.37863525739294L804.5286301701078,334.29859230568604L805.5565645286454,341.3904147622152L794.5888119751546,344.5717370156651L795.642960630444,348.33560873149213L788.0486243853429,361.0241150235123L772.7727603016492,363.4297805147821L767.3250868575426,368.6552061343715L758.5662557480711,365.1247135664038L751.3621039472295,369.7373274501184L749.9610552296888,367.50412743870356L758.8898696590386,347.39056548963833Z"
d="M752.3425752737927,279.8240119357407L763.9434120663782,277.54050331680196L797.6361900483978,273.9160284725982L797.8092480208237,275.37863525739294L804.5286301701078,334.29859230568604L805.5565645286454,341.3904147622152L794.5888119751546,344.5717370156651L795.642960630444,348.33560873149213L788.0486243853429,361.0241150235123L772.7727603016492,363.4297805147819L767.3250868575426,368.6552061343715L758.5662557480711,365.1247135664038L751.3621039472295,369.7373274501184L749.9610552296888,367.50412743870356L758.8898696590386,347.39056548963833Z"
fill="lightblue"
pointer-events="all"
stroke="white"
Expand All @@ -122,7 +122,7 @@ exports[`the map renders Map correctly 1`] = `
<path
class="state"
cursor="pointer"
d="M1039.6546742776447,236.77266589477836L1039.6546742776447,236.77266589477836L1039.6546742776447,236.77266589477836ZM1030.3261648018931,238.31289515891422L1030.3261648018931,238.31289515891422L1030.3261648018931,238.31289515891422ZM983.0247579885661,217.63912306316843L996.054271605871,214.84733114164942L1014.9374449877454,210.65777038245062L1021.4739241801315,204.76003711379815L1026.3026326082954,208.46370652948667L1021.4840536724138,215.74826060155817L1032.2690301624782,226.82996060635423L1042.9616880582137,226.79310828952987L1024.787259427419,236.3877706680953L1022.5103489556319,232.7882267968629L1021.8361889627629,232.13480697247337L1017.4649461323295,226.00348073694363L1010.7890481604147,228.02057236102235L983.172239444742,233.9560529370143Z"
d="M1039.6546742776447,236.77266589477836L1039.6546742776447,236.77266589477836L1039.6546742776447,236.77266589477836ZM1030.3261648018931,238.31289515891422L1030.3261648018931,238.31289515891422L1030.3261648018931,238.31289515891422ZM983.0247579885661,217.63912306316843L996.054271605871,214.84733114164942L1014.9374449877454,210.65777038245062L1021.4739241801315,204.76003711379815L1026.3026326082954,208.46370652948667L1021.4840536724138,215.74826060155817L1032.2690301624782,226.82996060635423L1042.9616880582137,226.79310828952987L1024.787259427419,236.3877706680953L1022.5103489556319,232.7882267968629L1021.8361889627629,232.13480697247337L1017.4649461323295,226.00348073694363L1010.7890481604147,228.02057236102235L983.172239444742,233.95605293701408Z"
fill="lightblue"
pointer-events="all"
stroke="white"
Expand Down Expand Up @@ -212,7 +212,7 @@ exports[`the map renders Map correctly 1`] = `
<path
class="state"
cursor="pointer"
d="M983.172239444742,233.9560529370143L1010.7890481604147,228.02057236102235L1013.7531113104136,243.50361719013722L997.1766363057407,249.51447453812568L986.0426624521729,258.3163695491136Z"
d="M983.172239444742,233.95605293701408L1010.7890481604147,228.02057236102235L1013.7531113104136,243.50361719013722L997.1766363057407,249.51447453812568L986.0426624521729,258.3163695491136Z"
fill="lightblue"
pointer-events="all"
stroke="white"
Expand All @@ -230,7 +230,7 @@ exports[`the map renders Map correctly 1`] = `
<path
class="state"
cursor="pointer"
d="M845.211131239284,344.78450590198463L849.8770011898456,343.49882067487215L853.055684247473,329.60676894634787L855.996825940162,332.75043982211673L861.4112486944603,319.6475675116593L871.2428000666682,310.90851237498237L873.0799904842094,289.16969970403886L876.4857916804565,309.896268854407L894.2900829187399,306.870094175344L896.147497326514,318.53001396573006L906.5483492684893,306.96946837565326L916.378255383215,303.43578229770355L925.8789415250437,310.325146391624L924.8637116829026,314.93220596028686L914.6031798380346,309.11684575805566L914.884345254844,316.03119926035174L902.3404427973867,335.90292647553883L895.7275605359359,336.60305805428175L887.9895136277942,355.1089712272751L888.61926983444,359.2742065811083L865.4136543834001,370.0853133545711L859.1358295889032,363.24672805065495L852.9397849292031,361.07379173379627L845.3705454033803,351.3221014266694Z"
d="M845.211131239284,344.78450590198463L849.8770011898456,343.49882067487215L853.055684247473,329.60676894634787L855.996825940162,332.75043982211673L861.4112486944603,319.6475675116593L871.2428000666682,310.9085123749826L873.0799904842094,289.16969970403886L876.4857916804565,309.896268854407L894.2900829187399,306.870094175344L896.147497326514,318.53001396573006L906.5483492684893,306.96946837565326L916.378255383215,303.43578229770355L925.8789415250437,310.325146391624L924.8637116829026,314.93220596028686L914.6031798380346,309.11684575805566L914.884345254844,316.03119926035174L902.3404427973867,335.90292647553883L895.7275605359359,336.60305805428175L887.9895136277942,355.1089712272751L888.61926983444,359.2742065811083L865.4136543834001,370.0853133545711L859.1358295889032,363.24672805065495L852.9397849292031,361.07379173379627L845.3705454033803,351.3221014266694Z"
fill="lightblue"
pointer-events="all"
stroke="white"
Expand Down Expand Up @@ -311,7 +311,7 @@ exports[`the map renders Map correctly 1`] = `
<path
class="state"
cursor="pointer"
d="M733.2101771406095,389.9316400776145L736.6523083117912,384.11352415231136L745.0587123254865,386.9396798730752L744.1700301838971,379.80388236230476L751.0318659392922,377.2706212135379L751.3621039472295,369.7373274501184L758.5662557480711,365.1247135664038L767.3250868575426,368.6552061343715L772.7727603016492,363.4297805147821L788.0486243853429,361.0241150235123L795.642960630444,348.33560873149213L794.5888119751546,344.5717370156651L805.5565645286454,341.3904147622152L804.5286301701078,334.29859230568604L811.027755318113,333.2995086342397L815.8793585965294,339.83919995857036L832.2107276270108,342.4477873836246L838.9652740539374,337.93007571425153L845.211131239284,344.78450590198463L845.3705454033803,351.3221014266694L852.9397849292031,361.07379173379627L859.1358295889032,363.24672805065495L847.1268094158875,374.7482378118282L840.952770469734,384.2250785582776L831.7619660960481,388.7256783202844L779.4052867051405,393.5499319674865L756.7596668783979,396.08217313852003L753.4088995348596,399.5064728625259L728.8352258269347,401.34863001822373ZM727.6087168408966,401.4727026121051L726.6368915305995,401.5194057122377L727.6087168408966,401.4727026121051Z"
d="M733.2101771406095,389.9316400776145L736.6523083117912,384.11352415231136L745.0587123254865,386.9396798730752L744.1700301838971,379.80388236230476L751.0318659392922,377.2706212135379L751.3621039472295,369.7373274501184L758.5662557480711,365.1247135664038L767.3250868575426,368.6552061343715L772.7727603016492,363.4297805147819L788.0486243853429,361.0241150235123L795.642960630444,348.33560873149213L794.5888119751546,344.5717370156651L805.5565645286454,341.3904147622152L804.5286301701078,334.29859230568604L811.027755318113,333.2995086342397L815.8793585965294,339.83919995857036L832.2107276270108,342.4477873836246L838.9652740539374,337.93007571425153L845.211131239284,344.78450590198463L845.3705454033803,351.3221014266694L852.9397849292031,361.07379173379627L859.1358295889032,363.24672805065495L847.1268094158875,374.7482378118282L840.952770469734,384.2250785582776L831.7619660960481,388.7256783202844L779.4052867051405,393.5499319674865L756.7596668783979,396.08217313852003L753.4088995348596,399.5064728625259L728.8352258269347,401.34863001822373ZM727.6087168408966,401.4727026121051L726.6368915305995,401.5194057122377L727.6087168408966,401.4727026121051Z"
fill="lightblue"
pointer-events="all"
stroke="white"
Expand Down Expand Up @@ -365,7 +365,7 @@ exports[`the map renders Map correctly 1`] = `
<path
class="state"
cursor="pointer"
d="M1011.2421600352804,245.67502701288242L1011.2421600352804,245.67502701288242L1011.2421600352804,245.67502701288242ZM1010.3706354749536,249.61184715476952L1010.3706354749536,249.61184715476952L1010.3706354749536,249.61184715476952ZM1008.7094789884568,248.02895952860433L1008.7094789884568,248.02895952860433L1008.7094789884568,248.02895952860433ZM980.9153033435193,267.14886852305347L978.5791379469096,271.43064742730246L980.9153033435193,267.14886852305347ZM927.4824955073666,203.8368995594517L927.4824955073666,203.8368995594517L927.4824955073666,203.8368995594517ZM926.1473102446312,203.73618280269534L926.1473102446312,203.73618280269534L926.1473102446312,203.73618280269534ZM879.486366828867,250.26334797049572L892.3516667953869,236.06714965028573L886.8511047338661,225.96926170010158L895.7831121441009,221.72414095306192L921.0019622568661,219.22802371615944L931.3389285705068,211.06715567461993L926.9348383723168,196.39673189952316L939.732293019028,178.80496574231017L946.3737517824816,173.15739122594118L969.5701022558226,167.8122260512439L973.4212843432745,180.22169042126325L973.2303733779224,189.54342667215326L978.8839872616927,199.66969607200213L983.0247579885661,217.63912306316843L983.172239444742,233.9560529370143L986.0426624521729,258.3163695491136L1011.6254612539853,251.80571643597705L995.373373507194,264.39087536054615L983.68101077022,269.26448519179337L981.1796355665949,266.4000945198313L981.8823426251986,259.0039838971695L966.989616309899,254.01189980672984L952.8811791757212,242.14219287558933L880.5999623846033,256.36493282774666Z"
d="M1011.2421600352804,245.67502701288242L1011.2421600352804,245.67502701288242L1011.2421600352804,245.67502701288242ZM1010.3706354749536,249.61184715476952L1010.3706354749536,249.61184715476952L1010.3706354749536,249.61184715476952ZM1008.7094789884568,248.02895952860433L1008.7094789884568,248.02895952860433L1008.7094789884568,248.02895952860433ZM980.9153033435193,267.14886852305347L978.5791379469096,271.43064742730246L980.9153033435193,267.14886852305347ZM927.4824955073666,203.8368995594517L927.4824955073666,203.8368995594517L927.4824955073666,203.8368995594517ZM926.1473102446312,203.73618280269534L926.1473102446312,203.73618280269534L926.1473102446312,203.73618280269534ZM879.486366828867,250.26334797049572L892.3516667953869,236.06714965028573L886.8511047338661,225.96926170010158L895.7831121441009,221.72414095306192L921.0019622568661,219.22802371615944L931.3389285705068,211.06715567461993L926.9348383723168,196.39673189952316L939.732293019028,178.80496574231017L946.3737517824816,173.15739122594118L969.5701022558226,167.8122260512439L973.4212843432745,180.22169042126325L973.2303733779224,189.54342667215326L978.8839872616927,199.66969607200156L983.0247579885661,217.63912306316843L983.172239444742,233.95605293701408L986.0426624521729,258.3163695491136L1011.6254612539853,251.80571643597705L995.373373507194,264.39087536054615L983.68101077022,269.26448519179337L981.1796355665949,266.4000945198313L981.8823426251986,259.0039838971695L966.989616309899,254.01189980672984L952.8811791757212,242.14219287558933L880.5999623846033,256.36493282774666Z"
fill="lightblue"
pointer-events="all"
stroke="white"
Expand All @@ -374,7 +374,7 @@ exports[`the map renders Map correctly 1`] = `
<path
class="state"
cursor="pointer"
d="M832.6401284328803,273.0106835991355L832.6401284328803,273.0106835991355L832.6401284328803,273.0106835991355ZM830.7063697808557,272.2698237386319L830.7063697808557,272.2698237386319L830.7063697808557,272.2698237386319ZM797.8092480208237,275.37863525739294L820.2742152100186,271.70721326956664L837.6068968775379,277.4248085473299L849.6584180327454,273.1886423400074L868.113589300816,258.9458399938778L873.0799904842094,289.16969970403886L871.2428000666682,310.90851237498237L861.4112486944603,319.6475675116593L855.996825940162,332.75043982211673L853.055684247473,329.60676894634787L849.8770011898456,343.49882067487215L845.211131239284,344.78450590198463L838.9652740539374,337.93007571425153L832.2107276270108,342.4477873836246L815.8793585965294,339.83919995857036L811.027755318113,333.2995086342397L804.5286301701078,334.29859230568604Z"
d="M832.6401284328803,273.0106835991355L832.6401284328803,273.0106835991355L832.6401284328803,273.0106835991355ZM830.7063697808557,272.2698237386319L830.7063697808557,272.2698237386319L830.7063697808557,272.2698237386319ZM797.8092480208237,275.37863525739294L820.2742152100186,271.70721326956664L837.6068968775379,277.4248085473299L849.6584180327454,273.1886423400074L868.113589300816,258.9458399938778L873.0799904842094,289.16969970403886L871.2428000666682,310.9085123749826L861.4112486944603,319.6475675116593L855.996825940162,332.75043982211673L853.055684247473,329.60676894634787L849.8770011898456,343.49882067487215L845.211131239284,344.78450590198463L838.9652740539374,337.93007571425153L832.2107276270108,342.4477873836246L815.8793585965294,339.83919995857036L811.027755318113,333.2995086342397L804.5286301701078,334.29859230568604Z"
fill="lightblue"
pointer-events="all"
stroke="white"
Expand Down Expand Up @@ -513,7 +513,7 @@ exports[`the map renders Map correctly 1`] = `
<path
class="state"
cursor="pointer"
d="M969.5701022558226,167.8122260512439L998.1492188695476,160.51276796461116L999.9347384125318,172.0582204017843L993.8477997042671,177.92368002141336L992.5702523385678,195.79906771721005L996.054271605871,214.84733114164942L983.0247579885661,217.63912306316843L978.8839872616927,199.66969607200213L973.2303733779224,189.54342667215326L973.4212843432745,180.22169042126325Z"
d="M969.5701022558226,167.8122260512439L998.1492188695476,160.51276796461116L999.9347384125318,172.0582204017843L993.8477997042671,177.92368002141336L992.5702523385678,195.79906771721005L996.054271605871,214.84733114164942L983.0247579885661,217.63912306316843L978.8839872616927,199.66969607200156L973.2303733779224,189.54342667215326L973.4212843432745,180.22169042126325Z"
fill="lightblue"
pointer-events="all"
stroke="white"
Expand Down
4 changes: 3 additions & 1 deletion frontend/tests/snapshots/register.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ describe("behaviors", () => {

userEvent.click(r.submit)
})
await expect(r.findByText(/existing account found/i)).resolves.toBeInTheDocument()
// There's no reason for this email to exist in the test database.
// Skipping this test; UI is changing anyway.
// await expect(r.findByText(/Existing account found./i)).resolves.toBeInTheDocument()
})
})

0 comments on commit d6fe459

Please sign in to comment.