From 75f34e63f5b771c0c0b5175cd00ca1f7e20a7038 Mon Sep 17 00:00:00 2001 From: tholulomo Date: Wed, 22 Mar 2023 13:28:19 -0400 Subject: [PATCH 1/8] perf(#362): Update countdown page trigger for all routes --- app/src/App.vue | 3 +++ app/tests/unit/app.spec.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 app/tests/unit/app.spec.js diff --git a/app/src/App.vue b/app/src/App.vue index 9662a401..5fc04f8b 100644 --- a/app/src/App.vue +++ b/app/src/App.vue @@ -12,6 +12,9 @@ export default { Snackbar }, async created () { + if (this.$store.getters.countDownDate - new Date().getTime() > 0) { + return this.$router.push('/countdown') + } await this.$store.dispatch('auth/tryLogin') } } diff --git a/app/tests/unit/app.spec.js b/app/tests/unit/app.spec.js new file mode 100644 index 00000000..57b4c51b --- /dev/null +++ b/app/tests/unit/app.spec.js @@ -0,0 +1,28 @@ +import createWrapper from '../jest/script/wrapper' +import { enableAutoDestroy } from '@vue/test-utils' +import App from '@/App.vue' +import router from '@/router' +import store from '@/store/index.js' + +// Spy on created method early +const route = jest.spyOn(router, 'push').mockImplementation(() => {}) +const dispatch = jest.spyOn(store, 'dispatch').mockImplementation(() => {}) + +describe('App.vue', () => { + let wrapper + beforeEach(async () => { + wrapper = await createWrapper(App, { }, false) + }) + + enableAutoDestroy(afterEach) + + it('mounts properly', () => { + expect(wrapper.find('.page-container').exists()).toBe(true) + expect(wrapper.find('#app').exists()).toBe(true) + if (wrapper.vm.$store.getters.countDownDate - new Date().getTime() > 0) { + expect(route).toHaveBeenCalledWith('/countdown') + } else { + expect(dispatch).toHaveBeenCalledWith('auth/tryLogin') + } + }) +}) From cbe8df36a49b998863ac2172990ade0749e5d1a4 Mon Sep 17 00:00:00 2001 From: tholulomo Date: Wed, 22 Mar 2023 13:30:57 -0400 Subject: [PATCH 2/8] fix(#358): Fix styling bugs --- app/src/assets/css/modules/_pages.scss | 23 ++++++++++++++++++++++- app/src/assets/css/modules/_utility.scss | 6 ++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app/src/assets/css/modules/_pages.scss b/app/src/assets/css/modules/_pages.scss index 7c0c0b8c..9e52e5e1 100644 --- a/app/src/assets/css/modules/_pages.scss +++ b/app/src/assets/css/modules/_pages.scss @@ -533,16 +533,37 @@ .countdown-page { & > .section_banner { - width: 100vw; height: 100vh; } + .header-logo { + @include respond(tab-land){ + width: 21rem; + } + } + + .form__input--adjust{ + border: 0.15rem solid rgba($primary-white, .5);; + } + + .visualize_header-h1 { + @include respond(phone){ + font-size: 3.8rem; + font-weight: 400; + margin: 1rem 0 0rem 0; + } + } + .clock__box{ background-color: rgba(0, 0, 0, 0.3); padding: 12px 16px; width: 12rem; max-width: 23%; border-bottom: .3rem solid #d7df71; + + @include respond(phone){ + padding: 4px 12px; + } } .p{ diff --git a/app/src/assets/css/modules/_utility.scss b/app/src/assets/css/modules/_utility.scss index 7d8496f9..2ae4600a 100644 --- a/app/src/assets/css/modules/_utility.scss +++ b/app/src/assets/css/modules/_utility.scss @@ -146,6 +146,12 @@ &-width { width: 99% !important; } + &-flex{ + display: flex; + &-column{ + flex-direction: column; + } + } &-flex-justify-se { justify-content: space-evenly; } From 04920dea30cffac0a4a640b9044d43198e931a19 Mon Sep 17 00:00:00 2001 From: tholulomo Date: Wed, 22 Mar 2023 13:31:55 -0400 Subject: [PATCH 3/8] perf(#362): Group drawer menu into appropriate sections --- app/src/components/Drawer.vue | 74 +++++++++++++++++------------------ 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/app/src/components/Drawer.vue b/app/src/components/Drawer.vue index 3d802e20..7a53cfbb 100644 --- a/app/src/components/Drawer.vue +++ b/app/src/components/Drawer.vue @@ -1,7 +1,12 @@