Skip to content

Commit

Permalink
Updated unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
weskubo-cgi authored and weskubo-cgi committed Oct 19, 2023
1 parent cffb2ec commit 26a734b
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 99 deletions.
23 changes: 8 additions & 15 deletions frontend/src/views/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<v-col cols="12" align="center" class="pt-0">
<v-img src="src/assets/images/login-header-img-resized.jpg" max-width="1448" class="align-end">
<v-col align="center" style="background-color: rgb(28, 115, 158, 0.85)">
<span class="text-h4 text-white font-weight-bold" style="font-family: BCSans">Early Childhood Care - Operating
Funding Model</span>
<span class="text-h4 text-white font-weight-bold" style="font-family: BCSans">Early Childhood Care - Operating Funding Model</span>
<br />
<span class="text-h6 text-white">Welcome</span>
</v-col>
Expand All @@ -18,17 +17,13 @@
<v-container class="containerWidth1450 pa-0">
<p class="pt-4">
<strong>NOTE:</strong>
The information collected through Early Childhood Care - Operating Funding Model is collected under the authority
of the
The information collected through Early Childhood Care - Operating Funding Model is collected under the authority of the
<i>Freedom of Information and Protection of Privacy Act</i>
(FOIPPA) and the
<i>Child Care BC Act</i>
(SBC 2001, c. 4) and will be used for the purpose of administering the Child Care Operating Funding Program, which
includes the Child Care Fee Reduction Initiative and the Early Childhood
Educator (ECE) Wage Enhancement for successfully enrolled applicants. Personal information is protected from
unauthorized use and disclosure in accordance with FOIPPA. Any questions or
concerns about the collection of this information can be directed to the Director, Child Care Operating Funding
Program, PO Box 9965 Stn Prov Govt, Victoria BC V8W 9R4, Phone: in Greater
(SBC 2001, c. 4) and will be used for the purpose of administering the Child Care Operating Funding Program, which includes the Child Care Fee Reduction Initiative and the Early Childhood
Educator (ECE) Wage Enhancement for successfully enrolled applicants. Personal information is protected from unauthorized use and disclosure in accordance with FOIPPA. Any questions or
concerns about the collection of this information can be directed to the Director, Child Care Operating Funding Program, PO Box 9965 Stn Prov Govt, Victoria BC V8W 9R4, Phone: in Greater
Victoria: 250 356-6501, outside of Greater Victoria, Toll Free: 1 888 338-6622 (option 2).
</p>
<br />
Expand All @@ -43,8 +38,7 @@
<v-card-text id="login_descriptor">Log in with your primary Business BCeID</v-card-text>
<v-spacer></v-spacer>
<v-card-actions class="mt-auto">
<AppButton icon="mdi-login" :href="routes.LOGIN" @click="clearStorage" width="250px">BCeID Log In
</AppButton>
<AppButton icon="mdi-login" :href="routes.LOGIN" @click="clearStorage" width="250px" id="bceid-login">BCeID Log In</AppButton>
</v-card-actions>
</v-card>
</v-col>
Expand All @@ -65,8 +59,7 @@
You must register for a Business BCeID before you can log in - it only takes a few minutes.
</v-card-text>
<v-card-actions>
<AppButton icon="mdi-login" href="//www.bceid.ca/register/business/getting_started/getting_started.aspx"
@click="clearStorage" width="250px">Register for a BCeID</AppButton>
<AppButton icon="mdi-login" href="//www.bceid.ca/register/business/getting_started/getting_started.aspx" @click="clearStorage" width="250px">Register for a BCeID</AppButton>
</v-card-actions>
</v-card>
</v-col>
Expand All @@ -87,7 +80,7 @@ export default {
components: { AppButton },
data() {
return {
routes: Routes
routes: Routes,
}
},
computed: {
Expand Down
3 changes: 1 addition & 2 deletions frontend/test/views/HomeView.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ describe('HomeView', () => {
const global = { global: { plugins: [createTestingPinia(), vuetify] } }
test('init', async () => {
const wrapper = mount(HomeView, global)
expect(wrapper.text()).toContain('OFM')
expect(wrapper.text()).toContain('Temp Home Screen')
// expect(wrapper.text()).toContain('Username:')
expect(wrapper.html()).toMatchSnapshot()
})
})
5 changes: 2 additions & 3 deletions frontend/test/views/LoginView.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ describe('LoginView', () => {
test('init', async () => {
const wrapper = mount(LoginView, global)
expect(wrapper.text()).toContain('BCeID')
expect(wrapper.text()).toContain('IDIR')
expect(wrapper.html()).toMatchSnapshot()
})

test('login', async () => {
const wrapper = mount(LoginView, global)

const loginButton = wrapper.get('#login-button')
expect(loginButton.attributes().href).toEqual('/api/auth/login-idir')
const loginButton = wrapper.get('#bceid-login')
expect(loginButton.attributes().href).toEqual('/api/auth/login')
})
})
32 changes: 1 addition & 31 deletions frontend/test/views/__snapshots__/HomeView.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`HomeView > init 1`] = `
"<div class=\\"v-card v-theme--light v-card--density-default v-card--variant-elevated\\" style=\\"height: 100%;\\">
<!---->
<div class=\\"v-card__loader\\">
<div class=\\"v-progress-linear v-theme--light v-locale--is-ltr\\" style=\\"top: 0px; height: 0px; --v-progress-linear-height: 2px; left: 50%; transform: translateX(-50%);\\" role=\\"progressbar\\" aria-hidden=\\"true\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
<!---->
<div class=\\"v-progress-linear__background\\" style=\\"width: 100%;\\"></div>
<transition-stub name=\\"fade-transition\\" appear=\\"false\\" persisted=\\"false\\" css=\\"true\\">
<div class=\\"v-progress-linear__indeterminate\\">
<div class=\\"v-progress-linear__indeterminate long\\"></div>
<div class=\\"v-progress-linear__indeterminate short\\"></div>
</div>
</transition-stub>
<!---->
</div>
</div>
<div class=\\"v-card-item\\">
<!---->
<div class=\\"v-card-item__content\\">
<div class=\\"v-card-title\\">OFM</div>
<div class=\\"v-card-subtitle\\">Temp Home Screen</div>
<!---->
</div>
<!---->
</div>
<div class=\\"v-card-text\\">...</div>
<!---->
<!---->
<!----><span class=\\"v-card__underlay\\"></span>
</div>"
`;
exports[`HomeView > init 1`] = `"<!--v-if-->"`;
117 changes: 69 additions & 48 deletions frontend/test/views/__snapshots__/LoginView.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,68 +5,89 @@ exports[`LoginView > init 1`] = `
<!-- login article -->
<!-- <article id=\\"login-banner\\" class=\\"top-banner\\"> -->
<div data-v-45f5edd7=\\"\\" class=\\"v-row align-center justify-center\\">
<div data-v-45f5edd7=\\"\\" class=\\"v-col\\" align=\\"center\\">
<div data-v-45f5edd7=\\"\\" class=\\"v-card v-theme--light v-card--density-default v-card--variant-elevated login-card\\">
<div data-v-45f5edd7=\\"\\" class=\\"v-col v-col-12 pt-0\\" align=\\"center\\">
<div data-v-45f5edd7=\\"\\" class=\\"v-responsive v-img v-img--booting align-end\\" style=\\"max-width: 1448px;\\">
<div class=\\"v-responsive__sizer\\"></div>
<transition-stub name=\\"fade-transition\\" appear=\\"true\\" persisted=\\"false\\" css=\\"true\\"><img class=\\"v-img__img v-img__img--contain\\" src=\\"src/assets/images/login-header-img-resized.jpg\\" style=\\"display: none;\\"></transition-stub>
<transition-stub name=\\"fade-transition\\" appear=\\"false\\" persisted=\\"false\\" css=\\"true\\">
<!---->
</transition-stub>
<!---->
<div class=\\"v-card__loader\\">
<div class=\\"v-progress-linear v-theme--light v-locale--is-ltr\\" style=\\"top: 0px; height: 0px; --v-progress-linear-height: 2px; left: 50%; transform: translateX(-50%);\\" role=\\"progressbar\\" aria-hidden=\\"true\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
<!---->
<div class=\\"v-progress-linear__background\\" style=\\"width: 100%;\\"></div>
<transition-stub name=\\"fade-transition\\" appear=\\"false\\" persisted=\\"false\\" css=\\"true\\">
<div class=\\"v-progress-linear__indeterminate\\">
<div class=\\"v-progress-linear__indeterminate long\\"></div>
<div class=\\"v-progress-linear__indeterminate short\\"></div>
</div>
</transition-stub>
<!---->
</div>
</div>
<!---->
<!---->
<div data-v-45f5edd7=\\"\\" class=\\"v-card-title gov-header\\">
<h4 data-v-45f5edd7=\\"\\" id=\\"login_text\\">IDIR</h4>
<div class=\\"v-responsive__content\\">
<div data-v-45f5edd7=\\"\\" class=\\"v-col\\" style=\\"background-color: rgb(28, 115, 158, 0.85);\\" align=\\"center\\"><span data-v-45f5edd7=\\"\\" class=\\"text-h4 text-white font-weight-bold\\" style=\\"font-family: BCSans;\\">Early Childhood Care - Operating Funding Model</span><br data-v-45f5edd7=\\"\\"><span data-v-45f5edd7=\\"\\" class=\\"text-h6 text-white\\">Welcome</span></div>
</div>
<div data-v-45f5edd7=\\"\\" class=\\"v-card-actions\\">
<div data-v-45f5edd7=\\"\\" class=\\"v-row align-center justify-center\\"><a data-v-45f5edd7=\\"\\" class=\\"v-btn v-theme--light text-white v-btn--density-default v-btn--size-default v-btn--variant-text ma-2 px-3\\" style=\\"background-color: #003366;\\" href=\\"/api/auth/login-idir\\" id=\\"login-button\\" dark=\\"\\"><span class=\\"v-btn__overlay\\"></span><span class=\\"v-btn__underlay\\"></span>
<!----><span class=\\"v-btn__content\\" data-no-activator=\\"\\"> Log In <i data-v-45f5edd7=\\"\\" class=\\"mdi-login mdi v-icon notranslate v-theme--light v-icon--size-default\\" aria-hidden=\\"true\\"></i></span>
</div>
</div>
</div>
<div data-v-45f5edd7=\\"\\" class=\\"v-container v-locale--is-ltr containerWidth1450 pa-0\\">
<p data-v-45f5edd7=\\"\\" class=\\"pt-4\\"><strong data-v-45f5edd7=\\"\\">NOTE:</strong> The information collected through Early Childhood Care - Operating Funding Model is collected under the authority of the <i data-v-45f5edd7=\\"\\">Freedom of Information and Protection of Privacy Act</i> (FOIPPA) and the <i data-v-45f5edd7=\\"\\">Child Care BC Act</i> (SBC 2001, c. 4) and will be used for the purpose of administering the Child Care Operating Funding Program, which includes the Child Care Fee Reduction Initiative and the Early Childhood Educator (ECE) Wage Enhancement for successfully enrolled applicants. Personal information is protected from unauthorized use and disclosure in accordance with FOIPPA. Any questions or concerns about the collection of this information can be directed to the Director, Child Care Operating Funding Program, PO Box 9965 Stn Prov Govt, Victoria BC V8W 9R4, Phone: in Greater Victoria: 250 356-6501, outside of Greater Victoria, Toll Free: 1 888 338-6622 (option 2). </p><br data-v-45f5edd7=\\"\\">
<div data-v-45f5edd7=\\"\\" class=\\"v-row\\">
<div data-v-45f5edd7=\\"\\" class=\\"v-col xs-12 lg-4 xl-2\\">
<hr data-v-45f5edd7=\\"\\" class=\\"v-divider v-theme--light\\" aria-orientation=\\"horizontal\\" role=\\"separator\\"><!-- Add height=\\"100%\\" to div directly below to have the buttons line up with each other on desktop.-->
<div data-v-45f5edd7=\\"\\" class=\\"v-card v-card--flat v-theme--light v-card--density-default v-card--variant-elevated d-flex flex-column\\">
<!---->
<div class=\\"v-card__loader\\">
<div class=\\"v-progress-linear v-theme--light v-locale--is-ltr\\" style=\\"top: 0px; height: 0px; --v-progress-linear-height: 2px; left: 50%; transform: translateX(-50%);\\" role=\\"progressbar\\" aria-hidden=\\"true\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
<!---->
<div class=\\"v-progress-linear__background\\" style=\\"width: 100%;\\"></div>
<transition-stub name=\\"fade-transition\\" appear=\\"false\\" persisted=\\"false\\" css=\\"true\\">
<div class=\\"v-progress-linear__indeterminate\\">
<div class=\\"v-progress-linear__indeterminate long\\"></div>
<div class=\\"v-progress-linear__indeterminate short\\"></div>
</div>
</transition-stub>
<!---->
</div>
</div>
<!---->
<!---->
<div data-v-45f5edd7=\\"\\" class=\\"v-card-title gov-header\\">
<h4 data-v-45f5edd7=\\"\\" id=\\"login_text\\">Childcare Provider</h4>
</div>
<div data-v-45f5edd7=\\"\\" class=\\"v-card-text\\" id=\\"login_descriptor\\">Log in with your primary Business BCeID</div>
<div data-v-45f5edd7=\\"\\" class=\\"v-spacer\\"></div>
<div data-v-45f5edd7=\\"\\" class=\\"v-card-actions mt-auto\\"><a data-v-d22d1084=\\"\\" data-v-45f5edd7=\\"\\" class=\\"v-btn v-btn--icon v-theme--light v-btn--density-default v-btn--size-default v-btn--variant-text BC-Gov-PrimaryButton\\" style=\\"width: 250px;\\" href=\\"/api/auth/login\\" id=\\"bceid-login\\"><span class=\\"v-btn__overlay\\"></span><span class=\\"v-btn__underlay\\"></span>
<!----><span class=\\"v-btn__content\\" data-no-activator=\\"\\">BCeID Log In<i data-v-d22d1084=\\"\\" class=\\"mdi-login mdi v-icon notranslate v-theme--light v-icon--size-default\\" aria-hidden=\\"true\\"></i></span>
<!---->
<!---->
</a></div>
<!---->
<!----><span class=\\"v-card__underlay\\"></span>
</div>
<!---->
<!----><span class=\\"v-card__underlay\\"></span>
</div>
</div>
<div data-v-45f5edd7=\\"\\" class=\\"v-col\\" align=\\"center\\">
<div data-v-45f5edd7=\\"\\" class=\\"v-card v-theme--light v-card--density-default v-card--variant-elevated login-card\\">
<!---->
<div class=\\"v-card__loader\\">
<div class=\\"v-progress-linear v-theme--light v-locale--is-ltr\\" style=\\"top: 0px; height: 0px; --v-progress-linear-height: 2px; left: 50%; transform: translateX(-50%);\\" role=\\"progressbar\\" aria-hidden=\\"true\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
<!---->
<div class=\\"v-progress-linear__background\\" style=\\"width: 100%;\\"></div>
<transition-stub name=\\"fade-transition\\" appear=\\"false\\" persisted=\\"false\\" css=\\"true\\">
<div class=\\"v-progress-linear__indeterminate\\">
<div class=\\"v-progress-linear__indeterminate long\\"></div>
<div class=\\"v-progress-linear__indeterminate short\\"></div>
</div>
</transition-stub>
<!---->
<div data-v-45f5edd7=\\"\\" class=\\"v-col xs-12 lg-6 xl-2\\">
<hr data-v-45f5edd7=\\"\\" class=\\"v-divider v-theme--light\\" aria-orientation=\\"horizontal\\" role=\\"separator\\">
<div data-v-45f5edd7=\\"\\" class=\\"v-card v-card--flat v-theme--light v-card--density-default v-card--variant-elevated d-flex flex-column\\">
<!---->
<div class=\\"v-card__loader\\">
<div class=\\"v-progress-linear v-theme--light v-locale--is-ltr\\" style=\\"top: 0px; height: 0px; --v-progress-linear-height: 2px; left: 50%; transform: translateX(-50%);\\" role=\\"progressbar\\" aria-hidden=\\"true\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
<!---->
<div class=\\"v-progress-linear__background\\" style=\\"width: 100%;\\"></div>
<transition-stub name=\\"fade-transition\\" appear=\\"false\\" persisted=\\"false\\" css=\\"true\\">
<div class=\\"v-progress-linear__indeterminate\\">
<div class=\\"v-progress-linear__indeterminate long\\"></div>
<div class=\\"v-progress-linear__indeterminate short\\"></div>
</div>
</transition-stub>
<!---->
</div>
</div>
</div>
<!---->
<!---->
<div data-v-45f5edd7=\\"\\" class=\\"v-card-title gov-header\\">
<h4 data-v-45f5edd7=\\"\\" id=\\"login_text\\">BCeID Log In</h4>
</div>
<div data-v-45f5edd7=\\"\\" class=\\"v-card-actions\\">
<div data-v-45f5edd7=\\"\\" class=\\"v-row align-center justify-center\\"><a data-v-45f5edd7=\\"\\" class=\\"v-btn v-theme--light text-white v-btn--density-default v-btn--size-default v-btn--variant-text ma-2 px-3\\" style=\\"background-color: #003366;\\" href=\\"/api/auth/login\\" id=\\"login-button\\" dark=\\"\\"><span class=\\"v-btn__overlay\\"></span><span class=\\"v-btn__underlay\\"></span>
<!----><span class=\\"v-btn__content\\" data-no-activator=\\"\\"> Business BCeID <i data-v-45f5edd7=\\"\\" class=\\"mdi-login mdi v-icon notranslate v-theme--light v-icon--size-default\\" aria-hidden=\\"true\\"></i></span>
<!---->
<!---->
<div data-v-45f5edd7=\\"\\" class=\\"v-card-title gov-header\\">
<h4 data-v-45f5edd7=\\"\\" id=\\"login_text\\">Don't have a BCeID?</h4>
</div>
<div data-v-45f5edd7=\\"\\" class=\\"v-card-text\\" id=\\"login_descriptor\\"> BCeID is a user ID and password. You can use it to log into many participating government services. <br data-v-45f5edd7=\\"\\"><br data-v-45f5edd7=\\"\\"> If you have logged into other B.C. government services before, you may already have an account. <br data-v-45f5edd7=\\"\\"><br data-v-45f5edd7=\\"\\"> You must register for a Business BCeID before you can log in - it only takes a few minutes. </div>
<div data-v-45f5edd7=\\"\\" class=\\"v-card-actions\\"><a data-v-d22d1084=\\"\\" data-v-45f5edd7=\\"\\" class=\\"v-btn v-btn--icon v-theme--light v-btn--density-default v-btn--size-default v-btn--variant-text BC-Gov-PrimaryButton\\" style=\\"width: 250px;\\" href=\\"//www.bceid.ca/register/business/getting_started/getting_started.aspx\\"><span class=\\"v-btn__overlay\\"></span><span class=\\"v-btn__underlay\\"></span>
<!----><span class=\\"v-btn__content\\" data-no-activator=\\"\\">Register for a BCeID<i data-v-d22d1084=\\"\\" class=\\"mdi-login mdi v-icon notranslate v-theme--light v-icon--size-default\\" aria-hidden=\\"true\\"></i></span>
<!---->
<!---->
</a></div>
<!---->
<!----><span class=\\"v-card__underlay\\"></span>
</div>
<!---->
<!----><span class=\\"v-card__underlay\\"></span>
</div>
</div>
</div><!-- </article> -->
Expand Down

0 comments on commit 26a734b

Please sign in to comment.