Added back jest support for unit testing, added mock unit test

This commit is contained in:
Frank 2021-10-27 11:24:32 -04:00
parent 6edc1222a5
commit da0ce5c07d
36 changed files with 21612 additions and 438 deletions

View file

@ -1,5 +1,3 @@
module.exports = { module.exports = {
presets: [ presets: ["@vue/cli-plugin-babel/preset"],
'@vue/cli-plugin-babel/preset' };
]
}

9
jest.config.js Normal file
View file

@ -0,0 +1,9 @@
module.exports = {
preset: "@vue/cli-plugin-unit-jest",
transform: {
"^.+\\.vue$": "vue-jest",
},
testMatch : [
"**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
],
};

21107
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -5,8 +5,8 @@
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"lint": "vue-cli-service lint", "test:unit": "vue-cli-service test:unit",
"test:unit": "vue-cli-service test:unit --coverage --coverageReporters=cobertura --coverageReporters=html --ci --watchAll=false --reporters=jest-junit --reporters=default" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@popperjs/core": "^2.10.2", "@popperjs/core": "^2.10.2",
@ -22,16 +22,20 @@
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-unit-jest": "~4.5.0",
"@vue/cli-service": "~4.5.0", "@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0", "@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-prettier": "^6.0.0", "@vue/eslint-config-prettier": "^6.0.0",
"@vue/test-utils": "^2.0.0-0",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"eslint": "^6.7.2", "eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1", "eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^7.0.0", "eslint-plugin-vue": "^7.0.0",
"prettier": "^2.2.1", "prettier": "^2.2.1",
"sass": "^1.26.5", "sass": "^1.26.5",
"sass-loader": "^8.0.2" "sass-loader": "^8.0.2",
"typescript": "~3.9.3",
"vue-jest": "^5.0.0-0"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,
@ -48,7 +52,18 @@
}, },
"rules": { "rules": {
"no-unused-vars": "off" "no-unused-vars": "off"
},
"overrides": [
{
"files": [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)"
],
"env": {
"jest": true
} }
}
]
}, },
"browserslist": [ "browserslist": [
"> 1%", "> 1%",

View file

@ -3,7 +3,9 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<p class="text-center text-secondary fs-5 mb-4">Select a year to get started</p> <p class="text-center text-secondary fs-5 mb-4">
Select a year to get started
</p>
<p class="text-center fs-6 fw-bold">What year is your vehichle?</p> <p class="text-center fs-6 fw-bold">What year is your vehichle?</p>
</div> </div>
</div> </div>
@ -13,16 +15,31 @@
</div> </div>
</div> </div>
<div class="row mt-5"> <div class="row mt-5">
<radioCard radioLabel="Windshield" radioImage="windshield-damage.svg" altText="Windshield" groupName="damageKey" radioID="windshield" /> <radioCard
<radioCard radioLabel="Side Window" radioImage="side-window-damage.svg" altText="Side Window" groupName="damageKey" radioID="sidewindow" /> radioLabel="Windshield"
<radioCard radioLabel="Back Glass" radioImage="back-glass-damage.svg" altText="Back Glass" groupName="damageKey" radioID="backglass" /> radioImage="windshield-damage.svg"
altText="Windshield"
groupName="damageKey"
radioID="windshield"
/>
<radioCard
radioLabel="Side Window"
radioImage="side-window-damage.svg"
altText="Side Window"
groupName="damageKey"
radioID="sidewindow"
/>
<radioCard
radioLabel="Back Glass"
radioImage="back-glass-damage.svg"
altText="Back Glass"
groupName="damageKey"
radioID="backglass"
/>
</div> </div>
<div class="row"> <div class="row">
<div class="col my-3 d-flex align-items-center"> <div class="col my-3 d-flex align-items-center">
<buttonPrimary <buttonPrimary buttonText="Primary" buttonType="btn-primary" />
buttonText="Primary"
buttonType="btn-primary"
/>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -35,10 +52,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col my-3 d-flex align-items-center"> <div class="col my-3 d-flex align-items-center">
<buttonPrimary <buttonPrimary buttonText="Disabled" buttonType="disabled" />
buttonText="Disabled"
buttonType="disabled"
/>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -50,13 +64,13 @@
</template> </template>
<script> <script>
import buttonPrimary from '@/uxComponents/buttonPrimary/buttonPrimary'; import buttonPrimary from "@/uxComponents/buttonPrimary/buttonPrimary";
import radioCard from '@/uxComponents/radioCard/radioCard'; import radioCard from "@/uxComponents/radioCard/radioCard";
export default { export default {
name: 'App', name: "App",
components: { components: {
buttonPrimary, buttonPrimary,
radioCard radioCard,
} },
} };
</script> </script>

View file

@ -0,0 +1,6 @@
describe("baseTemplate.vue", () => {
it("Is a test", () => {
expect(true).toBe(true);
});
});

View file

@ -11,15 +11,24 @@
</div> </div>
<div class="current_car_info"> <div class="current_car_info">
<transition appear name="fade"> <transition appear name="fade">
<div class="current_car_info-text" v-on:click="backFunction ? backFunction() : null"> <div
<span class="text-center text-secondary fs-5 d-block">{{ this.currentCarInfo }}</span> class="current_car_info-text"
<span v-if="style" class="text-center text-secondary fs-6 mt-2">{{ style }}</span> v-on:click="backFunction ? backFunction() : null"
>
<span class="text-center text-secondary fs-5 d-block">{{
this.currentCarInfo
}}</span>
<span v-if="style" class="text-center text-secondary fs-6 mt-2">{{
style
}}</span>
</div> </div>
</transition> </transition>
</div> </div>
<transition appear :name="slideTransition"> <transition appear :name="slideTransition">
<div class="needed_car_info d-flex overflow-hidden mt-4 mb-3"> <div class="needed_car_info d-flex overflow-hidden mt-4 mb-3">
<span class="text-center fs-6 fw-bold needed_car_info-text">{{ this.neededCarInfo }}</span> <span class="text-center fs-6 fw-bold needed_car_info-text">{{
this.neededCarInfo
}}</span>
</div> </div>
</transition> </transition>
</div> </div>
@ -31,17 +40,17 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex'; import { mapState } from "vuex";
export default { export default {
name: 'BaseTemplate', name: "BaseTemplate",
computed: { computed: {
...mapState(['slideTransition', 'carImg', 'blurImg', 'style']) ...mapState(["slideTransition", "carImg", "blurImg", "style"]),
}, },
props: { props: {
currentCarInfo: String, currentCarInfo: String,
neededCarInfo: String, neededCarInfo: String,
backFunction: Function backFunction: Function,
} },
} };
</script> </script>

View file

@ -0,0 +1 @@
test.todo('some test to be written in the future');

View file

@ -13,16 +13,16 @@
</template> </template>
<script> <script>
import buttonPrimary from '@/uxComponents/buttonPrimary/buttonPrimary'; import buttonPrimary from "@/uxComponents/buttonPrimary/buttonPrimary";
export default { export default {
name: 'CarAttributes', name: "CarAttributes",
props: { props: {
attritbutes: Array, attritbutes: Array,
selectAttribute: Function selectAttribute: Function,
}, },
components: { components: {
buttonPrimary buttonPrimary,
} },
} };
</script> </script>

View file

@ -0,0 +1 @@
test.todo('some test to be written in the future');

View file

@ -0,0 +1 @@
test.todo('some test to be written in the future');

View file

@ -1,6 +1,5 @@
<template> <template>
<div> <div>
<p>Not found</p> <p>Not found</p>
</div> </div>
</template> </template>

View file

@ -0,0 +1 @@
test.todo('some test to be written in the future');

View file

@ -1,6 +1,9 @@
<template> <template>
<div> <div>
<baseTemplate :currentCarInfo="year + ' ' + make + ' ' + model" neededCarInfo="What is your damage?"> <baseTemplate
:currentCarInfo="year + ' ' + make + ' ' + model"
neededCarInfo="What is your damage?"
>
<div class="damage-section text-center"> <div class="damage-section text-center">
<div class="choose-damage row"> <div class="choose-damage row">
<div class="col"> <div class="col">
@ -34,42 +37,41 @@
</div> </div>
</div> </div>
</div> </div>
</baseTemplate> </baseTemplate>
</div> </div>
</template> </template>
<script> <script>
import baseTemplate from '@/commonComponents/baseTemplate/baseTemplate'; import baseTemplate from "@/commonComponents/baseTemplate/baseTemplate";
import radioCard from '@/uxComponents/radioCard/radioCard'; import radioCard from "@/uxComponents/radioCard/radioCard";
import { import { mapState } from "vuex";
mapState
} from 'vuex'
export default { export default {
name: 'SelectCar', name: "SelectCar",
computed: { computed: {
...mapState(['year', 'make', 'model']) ...mapState(["year", "make", "model"]),
}, },
data() { data() {
return { return {
damage: '' damage: "",
} };
}, },
methods: { methods: {
chooseDamage(damage) { chooseDamage(damage) {
this.damage = damage this.damage = damage;
console.log(this.damage) console.log(this.damage);
}, },
goBack() { goBack() {
this.$store.state.slideTransition = 'slide_reverse'; this.$store.state.slideTransition = "slide_reverse";
this.$store.commit('removeStyle') this.$store.commit("removeStyle");
this.$router.push(`/select-style?year=${this.$store.state.year}&make=${this.$store.state.make}`); this.$router.push(
} `/select-style?year=${this.$store.state.year}&make=${this.$store.state.make}`
);
},
}, },
components: { components: {
baseTemplate, baseTemplate,
radioCard radioCard,
} },
} };
</script> </script>

View file

@ -0,0 +1 @@
test.todo('some test to be written in the future');

View file

@ -5,36 +5,33 @@
neededCarInfo="What make is your vehicle?" neededCarInfo="What make is your vehicle?"
:backFunction="goBack" :backFunction="goBack"
> >
<carAttributes <carAttributes :attritbutes="makes" :selectAttribute="selectMake" />
:attritbutes="makes"
:selectAttribute="selectMake"
/>
</baseTemplate> </baseTemplate>
</div> </div>
</template> </template>
<script> <script>
import baseTemplate from '@/commonComponents/baseTemplate/baseTemplate'; import baseTemplate from "@/commonComponents/baseTemplate/baseTemplate";
import carAttributes from '@/commonComponents/carAttributes/carAttributes'; import carAttributes from "@/commonComponents/carAttributes/carAttributes";
import { mapState } from 'vuex'; import { mapState } from "vuex";
export default { export default {
name: 'SelectCar', name: "SelectCar",
computed: { computed: {
...mapState(['year', 'makes']) ...mapState(["year", "makes"]),
}, },
methods: { methods: {
selectMake(make) { selectMake(make) {
this.$store.dispatch('selectMake', make); this.$store.dispatch("selectMake", make);
}, },
goBack() { goBack() {
this.$store.state.slideTransition = 'slide_reverse'; this.$store.state.slideTransition = "slide_reverse";
this.$router.push('/select-year'); this.$router.push("/select-year");
} },
}, },
components: { components: {
baseTemplate, baseTemplate,
carAttributes carAttributes,
} },
} };
</script> </script>

View file

@ -0,0 +1 @@
test.todo('some test to be written in the future');

View file

@ -5,36 +5,33 @@
:neededCarInfo="'What is the model of your ' + make + '?'" :neededCarInfo="'What is the model of your ' + make + '?'"
:backFunction="goBack" :backFunction="goBack"
> >
<carAttributes <carAttributes :attritbutes="models" :selectAttribute="selectModel" />
:attritbutes="models"
:selectAttribute="selectModel"
/>
</baseTemplate> </baseTemplate>
</div> </div>
</template> </template>
<script> <script>
import baseTemplate from '@/commonComponents/baseTemplate/baseTemplate'; import baseTemplate from "@/commonComponents/baseTemplate/baseTemplate";
import carAttributes from '@/commonComponents/carAttributes/carAttributes'; import carAttributes from "@/commonComponents/carAttributes/carAttributes";
import { mapState } from 'vuex' import { mapState } from "vuex";
export default { export default {
name: 'SelectCar', name: "SelectCar",
computed: { computed: {
...mapState(['year', 'make', 'models']) ...mapState(["year", "make", "models"]),
}, },
methods: { methods: {
selectModel(model) { selectModel(model) {
this.$store.dispatch('selectModel', model); this.$store.dispatch("selectModel", model);
}, },
goBack() { goBack() {
this.$store.state.slideTransition = 'slide_reverse'; this.$store.state.slideTransition = "slide_reverse";
this.$router.push(`/select-make?year=${this.$store.state.year}`); this.$router.push(`/select-make?year=${this.$store.state.year}`);
} },
}, },
components: { components: {
baseTemplate, baseTemplate,
carAttributes carAttributes,
} },
} };
</script> </script>

View file

@ -0,0 +1 @@
test.todo('some test to be written in the future');

View file

@ -5,36 +5,35 @@
:neededCarInfo="'What style is your ' + model + '?'" :neededCarInfo="'What style is your ' + model + '?'"
:backFunction="goBack" :backFunction="goBack"
> >
<carAttributes <carAttributes :attritbutes="styles" :selectAttribute="selectStyle" />
:attritbutes="styles"
:selectAttribute="selectStyle"
/>
</baseTemplate> </baseTemplate>
</div> </div>
</template> </template>
<script> <script>
import baseTemplate from '@/commonComponents/baseTemplate/baseTemplate'; import baseTemplate from "@/commonComponents/baseTemplate/baseTemplate";
import carAttributes from '@/commonComponents/carAttributes/carAttributes'; import carAttributes from "@/commonComponents/carAttributes/carAttributes";
import { mapState } from 'vuex' import { mapState } from "vuex";
export default { export default {
name: 'SelectCar', name: "SelectCar",
computed: { computed: {
...mapState(['year', 'make', 'model', 'styles']) ...mapState(["year", "make", "model", "styles"]),
}, },
methods: { methods: {
selectStyle(style) { selectStyle(style) {
this.$store.dispatch('selectStyle', style); this.$store.dispatch("selectStyle", style);
}, },
goBack() { goBack() {
this.$store.state.slideTransition = 'slide_reverse'; this.$store.state.slideTransition = "slide_reverse";
this.$router.push(`/select-model?year=${this.$store.state.year}&make=${this.$store.state.make}`); this.$router.push(
} `/select-model?year=${this.$store.state.year}&make=${this.$store.state.make}`
);
},
}, },
components: { components: {
baseTemplate, baseTemplate,
carAttributes carAttributes,
} },
} };
</script> </script>

View file

@ -0,0 +1 @@
test.todo('some test to be written in the future');

View file

@ -4,25 +4,22 @@
currentCarInfo="Select a year to get started" currentCarInfo="Select a year to get started"
neededCarInfo="What year is your vehicle?" neededCarInfo="What year is your vehicle?"
> >
<carAttributes <carAttributes :attritbutes="years" :selectAttribute="selectYear" />
:attritbutes="years"
:selectAttribute="selectYear"
/>
</baseTemplate> </baseTemplate>
</div> </div>
</template> </template>
<script> <script>
import baseTemplate from '@/commonComponents/baseTemplate/baseTemplate'; import baseTemplate from "@/commonComponents/baseTemplate/baseTemplate";
import carAttributes from '@/commonComponents/carAttributes/carAttributes'; import carAttributes from "@/commonComponents/carAttributes/carAttributes";
import axios from 'axios'; import axios from "axios";
export default { export default {
name: 'SelectCar', name: "SelectCar",
data() { data() {
return { return {
years: [] years: [],
} };
}, },
mounted() { mounted() {
axios.get("https://mockey.qa.sagaws.net/service/years").then((response) => { axios.get("https://mockey.qa.sagaws.net/service/years").then((response) => {
@ -31,12 +28,12 @@ export default {
}, },
methods: { methods: {
selectYear(year) { selectYear(year) {
this.$store.dispatch('selectYear', year); this.$store.dispatch("selectYear", year);
} },
}, },
components: { components: {
baseTemplate, baseTemplate,
carAttributes carAttributes,
} },
} };
</script> </script>

View file

@ -1,7 +1,7 @@
import { createApp } from "vue"; import { createApp } from "vue";
import App from "./App.vue"; import App from "./App.vue";
import router from './router'; import router from "./router";
import store from '@/store'; import store from "@/store";
//Bootstrap JavaScript //Bootstrap JavaScript
import "../node_modules/bootstrap/dist/js/bootstrap.js"; import "../node_modules/bootstrap/dist/js/bootstrap.js";

View file

@ -1,3 +1,3 @@
export function lazyLoadComponent(componentName) { export function lazyLoadComponent(componentName) {
return () => import(`@/layouts/${componentName}.vue`) return () => import(`@/layouts/${componentName}.vue`);
} }

View file

@ -4,10 +4,9 @@ import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js"
export function getRouteData(relativeUrl) { export function getRouteData(relativeUrl) {
return axios return axios
.post("/api/v1/content/RouteInfo", { .post("/api/v1/content/RouteInfo", {
relativeUrl: relativeUrl relativeUrl: relativeUrl,
}) })
.then((response) => { .then((response) => {
// This is really only for Mockey. In a real case, this would just be a 404 and we would check status code. // This is really only for Mockey. In a real case, this would just be a 404 and we would check status code.
if (response.data.Result === undefined) { if (response.data.Result === undefined) {
return Promise.reject("Could not find any details about given route."); return Promise.reject("Could not find any details about given route.");
@ -26,7 +25,6 @@ export function getRouteData(relativeUrl) {
}); });
}); });
return Promise.resolve(routeData); return Promise.resolve(routeData);
}); });
} }

View file

@ -12,12 +12,12 @@ const routes = [
{ {
path: "/", path: "/",
Name: "Home", Name: "Home",
component: Home component: Home,
}, },
]; ];
const router = createRouter({ const router = createRouter({
history: createWebHistory('/fmg/'), history: createWebHistory("/fmg/"),
routes, routes,
}); });
@ -26,13 +26,11 @@ router.beforeEach(async (to, from, next) => {
}); });
async function GoToDynamicRoute(to, next) { async function GoToDynamicRoute(to, next) {
let doesRouteResolve = router.resolve(to.path).matched.length > 0; let doesRouteResolve = router.resolve(to.path).matched.length > 0;
console.log("Does route resolve?" + " " + (doesRouteResolve ? "Yes" : "No")); console.log("Does route resolve?" + " " + (doesRouteResolve ? "Yes" : "No"));
if (!doesRouteResolve) { if (!doesRouteResolve) {
let routeData = await getRouteData(to.path).catch((exp) => { let routeData = await getRouteData(to.path).catch((exp) => {
console.log(exp); console.log(exp);
next({ name: "NotFound" }); // Go to 404. next({ name: "NotFound" }); // Go to 404.

View file

@ -1,72 +1,86 @@
import { createStore } from 'vuex'; import { createStore } from "vuex";
import createPersistedState from 'vuex-persistedstate'; import createPersistedState from "vuex-persistedstate";
import axios from 'axios'; import axios from "axios";
import router from '@/router'; import router from "@/router";
export default createStore({ export default createStore({
plugins: [createPersistedState({ plugins: [
createPersistedState({
storage: window.sessionStorage, storage: window.sessionStorage,
})], }),
],
state: { state: {
makes: [], makes: [],
models: [], models: [],
styles: [], styles: [],
year: '', year: "",
make: '', make: "",
model: '', model: "",
style: '', style: "",
slideTransition: 'none', slideTransition: "none",
carImg: "https://s3.amazonaws.com/safelite-lab-vehicle-images/Evox/8963_cc0320_032_UG_white_2014_Ford_Focus_18029225538399034889.jpg", carImg:
blurImg: true "https://s3.amazonaws.com/safelite-lab-vehicle-images/Evox/8963_cc0320_032_UG_white_2014_Ford_Focus_18029225538399034889.jpg",
blurImg: true,
}, },
mutations: { mutations: {
updateYear(state, data) { updateYear(state, data) {
state.year = data.year; state.year = data.year;
state.makes = data.makes.data.Result; state.makes = data.makes.data.Result;
state.slideTransition = 'slide' state.slideTransition = "slide";
}, },
updateMake(state, data) { updateMake(state, data) {
state.make = data.make; state.make = data.make;
state.models = data.models.data.Result; state.models = data.models.data.Result;
state.slideTransition = 'slide'; state.slideTransition = "slide";
}, },
updateModel(state, data) { updateModel(state, data) {
state.model = data.model; state.model = data.model;
state.styles = data.styles.data.Result; state.styles = data.styles.data.Result;
state.slideTransition = 'slide'; state.slideTransition = "slide";
}, },
updateStyle(state, data) { updateStyle(state, data) {
state.style = data.style; state.style = data.style;
state.carImg = "https://s3.amazonaws.com/safelite-lab-vehicle-images/Evox/8963_cc0320_032_UG_white_2014_Ford_Focus_18029225538399034889.jpg"; state.carImg =
"https://s3.amazonaws.com/safelite-lab-vehicle-images/Evox/8963_cc0320_032_UG_white_2014_Ford_Focus_18029225538399034889.jpg";
state.blurImg = false; state.blurImg = false;
state.slideTransition = 'slide'; state.slideTransition = "slide";
}, },
removeStyle(state) { removeStyle(state) {
state.style = ''; state.style = "";
state.blurImg = true; state.blurImg = true;
state.carImg = 'https://s3.amazonaws.com/safelite-lab-vehicle-images/Evox/8963_cc0320_032_UG_white_2014_Ford_Focus_18029225538399034889.jpg' state.carImg =
} "https://s3.amazonaws.com/safelite-lab-vehicle-images/Evox/8963_cc0320_032_UG_white_2014_Ford_Focus_18029225538399034889.jpg";
},
}, },
actions: { actions: {
async selectYear(context, year) { async selectYear(context, year) {
const makes = await axios.get(`https://mockey.qa.sagaws.net/service/makes/year=${year}`); const makes = await axios.get(
context.commit('updateYear', {year, makes}); `https://mockey.qa.sagaws.net/service/makes/year=${year}`
);
context.commit("updateYear", { year, makes });
router.push(`/select-make?year=${year}`); router.push(`/select-make?year=${year}`);
}, },
async selectMake({ commit, state }, make) { async selectMake({ commit, state }, make) {
const models = await axios.get(`https://mockey.qa.sagaws.net/service/models/year=${state.year}/make=${make}`); const models = await axios.get(
commit('updateMake', {make, models}); `https://mockey.qa.sagaws.net/service/models/year=${state.year}/make=${make}`
);
commit("updateMake", { make, models });
router.push(`/select-model?year=${state.year}&make=${make}`); router.push(`/select-model?year=${state.year}&make=${make}`);
}, },
async selectModel({ commit, state }, model) { async selectModel({ commit, state }, model) {
const styles = await axios.get(`https://mockey.qa.sagaws.net/service/styles/year=${state.year}/make=${state.make}/model=${model}`); const styles = await axios.get(
commit('updateModel', {model, styles}); `https://mockey.qa.sagaws.net/service/styles/year=${state.year}/make=${state.make}/model=${model}`
router.push(`/select-style?year=${state.year}&make=${state.make}&model=${model}`); );
commit("updateModel", { model, styles });
router.push(
`/select-style?year=${state.year}&make=${state.make}&model=${model}`
);
}, },
selectStyle({ commit, state }, style) { selectStyle({ commit, state }, style) {
commit('updateStyle', {style}); commit("updateStyle", { style });
router.push(`/damage?year=${state.year}&make=${state.make}&model=${state.model}&style=${style}`); router.push(
} `/damage?year=${state.year}&make=${state.make}&model=${state.model}&style=${style}`
} );
},
}) },
});

View file

@ -0,0 +1 @@
test.todo('some test to be written in the future');

View file

@ -3,7 +3,10 @@
type="button" type="button"
class="btn d-flex align-items-center" class="btn d-flex align-items-center"
v-on:click="showLoader()" v-on:click="showLoader()"
v-bind:class="[(this.isLoading ? 'button-loader' : 'not-loading'),this.buttonType]" v-bind:class="[
this.isLoading ? 'button-loader' : 'not-loading',
this.buttonType,
]"
> >
{{ this.buttonText }} {{ this.buttonText }}
</button> </button>
@ -11,20 +14,20 @@
<script> <script>
export default { export default {
name: 'buttonPrimary', name: "buttonPrimary",
props: { props: {
buttonText: String, buttonText: String,
buttonType: String buttonType: String,
}, },
data() { data() {
return { return {
isLoading: false isLoading: false,
} };
}, },
methods: { methods: {
showLoader() { showLoader() {
this.isLoading = true; this.isLoading = true;
} },
} },
} };
</script> </script>

View file

@ -0,0 +1 @@
test.todo('some test to be written in the future');

View file

@ -1,15 +1,18 @@
<script> <script>
import confetti from '/node_modules/canvas-confetti/src/confetti.js'; import confetti from "/node_modules/canvas-confetti/src/confetti.js";
setTimeout(function(){// Adjust timing of confetti event on page load setTimeout(function () {
// Adjust timing of confetti event on page load
var count = 200; var count = 200;
var defaults = { var defaults = {
origin: { y: 0.7 } origin: { y: 0.7 },
}; };
function fire(particleRatio, opts) { function fire(particleRatio, opts) {
confetti(Object.assign({}, defaults, opts, { confetti(
particleCount: Math.floor(count * particleRatio) Object.assign({}, defaults, opts, {
})); particleCount: Math.floor(count * particleRatio),
})
);
} }
fire(0.25, { fire(0.25, {
@ -22,13 +25,13 @@ setTimeout(function(){// Adjust timing of confetti event on page load
fire(0.35, { fire(0.35, {
spread: 100, spread: 100,
decay: 0.91, decay: 0.91,
scalar: 0.8 scalar: 0.8,
}); });
fire(0.1, { fire(0.1, {
spread: 120, spread: 120,
startVelocity: 25, startVelocity: 25,
decay: 0.92, decay: 0.92,
scalar: 1.2 scalar: 1.2,
}); });
fire(0.1, { fire(0.1, {
spread: 120, spread: 120,
@ -36,6 +39,6 @@ setTimeout(function(){// Adjust timing of confetti event on page load
}); });
}, 1000); // 1000 = 1second }, 1000); // 1000 = 1second
export default { export default {
name: 'confetti' name: "confetti",
} };
</script> </script>

View file

@ -0,0 +1 @@
test.todo('some test to be written in the future');

View file

@ -1,8 +1,24 @@
<template> <template>
<div class="col-4 mb-3 d-flex radio-card"> <div class="col-4 mb-3 d-flex radio-card">
<input type="radio" class="position-absolute opacity-0" v-bind:class="className" v-bind:id="radioID" v-bind:name="groupName" :value="radioLabel" v-model="picked" v-bind:tabindex="tabIndex"/> <input
<label v-bind:for="radioID" class="rounded-3 d-flex flex-column align-items-center w-100"> type="radio"
<img class="px-3 pt-3 pb-2 mt-auto" v-bind:src="require(`@/assets/img/icons/${radioImage}`)" v-bind:alt="altText"/> class="position-absolute opacity-0"
v-bind:class="className"
v-bind:id="radioID"
v-bind:name="groupName"
:value="radioLabel"
v-model="picked"
v-bind:tabindex="tabIndex"
/>
<label
v-bind:for="radioID"
class="rounded-3 d-flex flex-column align-items-center w-100"
>
<img
class="px-3 pt-3 pb-2 mt-auto"
v-bind:src="require(`@/assets/img/icons/${radioImage}`)"
v-bind:alt="altText"
/>
<span class="mt-auto mb-2">{{ radioLabel }}</span> <span class="mt-auto mb-2">{{ radioLabel }}</span>
</label> </label>
</div> </div>
@ -12,12 +28,20 @@
<script> <script>
export default { export default {
name: 'radioCard', name: "radioCard",
props: ['groupName','radioLabel','radioImage','altText','radioID','tabIndex','className'], props: [
"groupName",
"radioLabel",
"radioImage",
"altText",
"radioID",
"tabIndex",
"className",
],
data() { data() {
return { return {
picked: "picked" picked: "picked",
};
},
}; };
}
}
</script> </script>

View file

@ -1,14 +1,14 @@
module.exports = { module.exports = {
outputDir: 'dist/fmg', outputDir: "dist/fmg",
publicPath: '/fmg', publicPath: "/fmg",
devServer: { devServer: {
port: 8080, port: 8080,
proxy: { proxy: {
'api/v1/content*':{ "api/v1/content*": {
target: 'https://localhost:44360/', target: "https://localhost:44360/",
ws: false, ws: false,
changeOrigin: true changeOrigin: true,
} },
} },
} },
} };

View file

@ -1,4 +1,4 @@
module.exports = { module.exports = {
outputDir: 'dist/fmg', outputDir: "dist/fmg",
publicPath: '/fmg' publicPath: "/fmg",
} };