Merge pull request #214 from Safelite/feature/CSR-339_defect
Feature/csr 339 defect
This commit is contained in:
commit
5b6e96809f
9 changed files with 32 additions and 24 deletions
|
|
@ -19,7 +19,7 @@
|
||||||
:textPosition="textPosition"
|
:textPosition="textPosition"
|
||||||
:isMultiSelect="isMultiSelect"
|
:isMultiSelect="isMultiSelect"
|
||||||
:groupName="groupName"
|
:groupName="groupName"
|
||||||
:loaderEnabled="loaderEnabled"
|
:selectingInitiatesLoad="selectingInitiatesLoad"
|
||||||
:loaderColor="loaderColor"
|
:loaderColor="loaderColor"
|
||||||
:loaderPosition="loaderPosition"
|
:loaderPosition="loaderPosition"
|
||||||
:sizeInRem="sizeInRem"
|
:sizeInRem="sizeInRem"
|
||||||
|
|
@ -65,7 +65,7 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: "text-center",
|
default: "text-center",
|
||||||
},
|
},
|
||||||
loaderEnabled: Boolean,
|
selectingInitiatesLoad: Boolean,
|
||||||
loaderColor: {
|
loaderColor: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "blue",
|
default: "blue",
|
||||||
|
|
@ -138,7 +138,7 @@ export default {
|
||||||
val.isChecked ? newSelectedValues.push(val.buttonId) : newSelectedValues.splice(newSelectedValues.indexOf(val.buttonId), 1);
|
val.isChecked ? newSelectedValues.push(val.buttonId) : newSelectedValues.splice(newSelectedValues.indexOf(val.buttonId), 1);
|
||||||
this.selectedValues = newSelectedValues;
|
this.selectedValues = newSelectedValues;
|
||||||
} else {
|
} else {
|
||||||
this.selectedValues = [val.buttonId]
|
this.selectedValues = [val.buttonId];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
<buttonQuestion
|
<buttonQuestion
|
||||||
class="radioQuestion"
|
class="radioQuestion"
|
||||||
isOverflowScrollable
|
isOverflowScrollable
|
||||||
|
selectingInitiatesLoad
|
||||||
:questionText="questionText"
|
:questionText="questionText"
|
||||||
:answers="makes"
|
:answers="makes"
|
||||||
groupName="Choose Vehicle Make"
|
groupName="Choose Vehicle Make"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
:loaderEnabled="true"
|
|
||||||
v-model="selectedValueAsArray"
|
v-model="selectedValueAsArray"
|
||||||
isRequired=true
|
isRequired=true
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
<buttonQuestion
|
<buttonQuestion
|
||||||
class="radioQuestion"
|
class="radioQuestion"
|
||||||
isOverflowScrollable
|
isOverflowScrollable
|
||||||
|
selectingInitiatesLoad
|
||||||
:questionText="questionText"
|
:questionText="questionText"
|
||||||
:answers="models"
|
:answers="models"
|
||||||
groupName="Choose Vehicle Model"
|
groupName="Choose Vehicle Model"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
:loaderEnabled="true"
|
|
||||||
v-model="selectedValueAsArray"
|
v-model="selectedValueAsArray"
|
||||||
isRequired=true
|
isRequired=true
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
<buttonQuestion
|
<buttonQuestion
|
||||||
class="radioQuestion"
|
class="radioQuestion"
|
||||||
isOverflowScrollable
|
isOverflowScrollable
|
||||||
|
selectingInitiatesLoad
|
||||||
:questionText="questionText"
|
:questionText="questionText"
|
||||||
:answers="styles"
|
:answers="styles"
|
||||||
groupName="Choose Vehicle Style"
|
groupName="Choose Vehicle Style"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
:loaderEnabled="true"
|
|
||||||
v-model="selectedValueAsArray"
|
v-model="selectedValueAsArray"
|
||||||
isRequired=true
|
isRequired=true
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
<buttonQuestion
|
<buttonQuestion
|
||||||
class="radioQuestion"
|
class="radioQuestion"
|
||||||
isOverflowScrollable
|
isOverflowScrollable
|
||||||
|
selectingInitiatesLoad
|
||||||
:questionText="questionText"
|
:questionText="questionText"
|
||||||
:answers="years"
|
:answers="years"
|
||||||
groupName="Choose Vehicle Year"
|
groupName="Choose Vehicle Year"
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
:loaderEnabled="true"
|
|
||||||
v-model="selectedValueAsArray"
|
v-model="selectedValueAsArray"
|
||||||
isRequired=true
|
isRequired=true
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ describe("list-button-horizontal.vue", () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listButtonHorizontal, {
|
const wrapper = shallowMount(listButtonHorizontal, {
|
||||||
propsData: {
|
propsData: {
|
||||||
loaderEnabled: true,
|
selectingInitiatesLoad: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -99,6 +99,7 @@ describe("list-button-horizontal.vue", () => {
|
||||||
|
|
||||||
const label = wrapper.find("label");
|
const label = wrapper.find("label");
|
||||||
|
|
||||||
|
wrapper.vm.handleCheckChange = jest.fn();
|
||||||
wrapper.vm.handleClick();
|
wrapper.vm.handleClick();
|
||||||
|
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
@ -113,7 +114,7 @@ describe("list-button-horizontal.vue", () => {
|
||||||
const wrapper = shallowMount(listButtonHorizontal, {
|
const wrapper = shallowMount(listButtonHorizontal, {
|
||||||
propsData: {
|
propsData: {
|
||||||
loaderColor: "blue",
|
loaderColor: "blue",
|
||||||
loaderEnabled: true,
|
selectingInitiatesLoad: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -121,6 +122,7 @@ describe("list-button-horizontal.vue", () => {
|
||||||
|
|
||||||
const label = wrapper.find("label");
|
const label = wrapper.find("label");
|
||||||
|
|
||||||
|
wrapper.vm.handleCheckChange = jest.fn();
|
||||||
wrapper.vm.handleClick();
|
wrapper.vm.handleClick();
|
||||||
|
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
@ -135,7 +137,7 @@ describe("list-button-horizontal.vue", () => {
|
||||||
const wrapper = shallowMount(listButtonHorizontal, {
|
const wrapper = shallowMount(listButtonHorizontal, {
|
||||||
propsData: {
|
propsData: {
|
||||||
loaderPosition: "right",
|
loaderPosition: "right",
|
||||||
loaderEnabled: true,
|
selectingInitiatesLoad: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -143,6 +145,7 @@ describe("list-button-horizontal.vue", () => {
|
||||||
|
|
||||||
const label = wrapper.find("label");
|
const label = wrapper.find("label");
|
||||||
|
|
||||||
|
wrapper.vm.handleCheckChange = jest.fn();
|
||||||
wrapper.vm.handleClick();
|
wrapper.vm.handleClick();
|
||||||
|
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
@ -157,7 +160,7 @@ describe("list-button-horizontal.vue", () => {
|
||||||
const wrapper = shallowMount(listButtonHorizontal, {
|
const wrapper = shallowMount(listButtonHorizontal, {
|
||||||
propsData: {
|
propsData: {
|
||||||
sizeInRem: 1,
|
sizeInRem: 1,
|
||||||
loaderEnabled: true,
|
selectingInitiatesLoad: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -165,6 +168,7 @@ describe("list-button-horizontal.vue", () => {
|
||||||
|
|
||||||
const label = wrapper.find("label");
|
const label = wrapper.find("label");
|
||||||
|
|
||||||
|
wrapper.vm.handleCheckChange = jest.fn();
|
||||||
wrapper.vm.handleClick();
|
wrapper.vm.handleClick();
|
||||||
|
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
:aria-required="isRequired"
|
:aria-required="isRequired"
|
||||||
:data-focus-target="groupName"
|
:data-focus-target="groupName"
|
||||||
v-model="checkValue"
|
v-model="checkValue"
|
||||||
@change="handleCheckChange"
|
@change="!selectingInitiatesLoad ? handleCheckChange : ''"
|
||||||
/>
|
/>
|
||||||
<label
|
<label
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
|
|
@ -60,7 +60,7 @@ export default {
|
||||||
buttonLabelSubCopy: String,
|
buttonLabelSubCopy: String,
|
||||||
screenReaderOnlyText: String,
|
screenReaderOnlyText: String,
|
||||||
textPosition: String,
|
textPosition: String,
|
||||||
loaderEnabled: Boolean,
|
selectingInitiatesLoad: Boolean,
|
||||||
loaderColor: String,
|
loaderColor: String,
|
||||||
loaderPosition: String,
|
loaderPosition: String,
|
||||||
sizeInRem: [Number, String],
|
sizeInRem: [Number, String],
|
||||||
|
|
@ -88,8 +88,9 @@ export default {
|
||||||
this.isLoaderDisplayed = true;
|
this.isLoaderDisplayed = true;
|
||||||
},
|
},
|
||||||
handleClick(value) {
|
handleClick(value) {
|
||||||
if (this.loaderEnabled) {
|
if(this.selectingInitiatesLoad) {
|
||||||
this.displayLoader();
|
this.displayLoader();
|
||||||
|
this.handleCheckChange();
|
||||||
}
|
}
|
||||||
this.handleChange(value);
|
this.handleChange(value);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ describe("list-button.vue", () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listButton, {
|
const wrapper = shallowMount(listButton, {
|
||||||
propsData: {
|
propsData: {
|
||||||
loaderEnabled: true,
|
selectingInitiatesLoad: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -99,6 +99,7 @@ describe("list-button.vue", () => {
|
||||||
|
|
||||||
const label = wrapper.find("label");
|
const label = wrapper.find("label");
|
||||||
|
|
||||||
|
wrapper.vm.handleCheckChange = jest.fn();
|
||||||
wrapper.vm.handleClick();
|
wrapper.vm.handleClick();
|
||||||
|
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
@ -113,16 +114,15 @@ describe("list-button.vue", () => {
|
||||||
const wrapper = shallowMount(listButton, {
|
const wrapper = shallowMount(listButton, {
|
||||||
propsData: {
|
propsData: {
|
||||||
loaderColor: "blue",
|
loaderColor: "blue",
|
||||||
loaderEnabled: true,
|
selectingInitiatesLoad: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
|
|
||||||
const label = wrapper.find("label");
|
const label = wrapper.find("label");
|
||||||
|
wrapper.vm.handleCheckChange = jest.fn();
|
||||||
wrapper.vm.handleClick();
|
wrapper.vm.handleClick();
|
||||||
|
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
||||||
const loader = wrapper.find("loader-stub");
|
const loader = wrapper.find("loader-stub");
|
||||||
|
|
@ -135,7 +135,7 @@ describe("list-button.vue", () => {
|
||||||
const wrapper = shallowMount(listButton, {
|
const wrapper = shallowMount(listButton, {
|
||||||
propsData: {
|
propsData: {
|
||||||
loaderPosition: "right",
|
loaderPosition: "right",
|
||||||
loaderEnabled: true,
|
selectingInitiatesLoad: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -143,6 +143,7 @@ describe("list-button.vue", () => {
|
||||||
|
|
||||||
const label = wrapper.find("label");
|
const label = wrapper.find("label");
|
||||||
|
|
||||||
|
wrapper.vm.handleCheckChange = jest.fn();
|
||||||
wrapper.vm.handleClick();
|
wrapper.vm.handleClick();
|
||||||
|
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
@ -157,7 +158,7 @@ describe("list-button.vue", () => {
|
||||||
const wrapper = shallowMount(listButton, {
|
const wrapper = shallowMount(listButton, {
|
||||||
propsData: {
|
propsData: {
|
||||||
sizeInRem: 1,
|
sizeInRem: 1,
|
||||||
loaderEnabled: true,
|
selectingInitiatesLoad: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -165,6 +166,7 @@ describe("list-button.vue", () => {
|
||||||
|
|
||||||
const label = wrapper.find("label");
|
const label = wrapper.find("label");
|
||||||
|
|
||||||
|
wrapper.vm.handleCheckChange = jest.fn();
|
||||||
wrapper.vm.handleClick();
|
wrapper.vm.handleClick();
|
||||||
|
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
:aria-required="isRequired"
|
:aria-required="isRequired"
|
||||||
:data-focus-target="groupName"
|
:data-focus-target="groupName"
|
||||||
v-model="checkValue"
|
v-model="checkValue"
|
||||||
@change="handleCheckChange"
|
@change="!selectingInitiatesLoad ? handleCheckChange : ''"
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
|
|
@ -63,7 +63,7 @@ export default {
|
||||||
textPosition: String,
|
textPosition: String,
|
||||||
buttonLabelSubCopy: String,
|
buttonLabelSubCopy: String,
|
||||||
screenReaderOnlyText: String,
|
screenReaderOnlyText: String,
|
||||||
loaderEnabled: Boolean,
|
selectingInitiatesLoad: Boolean,
|
||||||
loaderColor: String,
|
loaderColor: String,
|
||||||
loaderPosition: String,
|
loaderPosition: String,
|
||||||
sizeInRem: [Number,String],
|
sizeInRem: [Number,String],
|
||||||
|
|
@ -90,8 +90,9 @@ export default {
|
||||||
this.isLoaderDisplayed = true;
|
this.isLoaderDisplayed = true;
|
||||||
},
|
},
|
||||||
handleClick(value) {
|
handleClick(value) {
|
||||||
if (this.loaderEnabled) {
|
if(this.selectingInitiatesLoad) {
|
||||||
this.displayLoader();
|
this.displayLoader();
|
||||||
|
this.handleCheckChange();
|
||||||
}
|
}
|
||||||
this.handleChange(value);
|
this.handleChange(value);
|
||||||
},
|
},
|
||||||
|
|
@ -100,7 +101,7 @@ export default {
|
||||||
if (!isInitialization) {
|
if (!isInitialization) {
|
||||||
this.$emit('isCheckedChanged', { isChecked: this.checkValue, buttonId: this.buttonID.toString() });
|
this.$emit('isCheckedChanged', { isChecked: this.checkValue, buttonId: this.buttonID.toString() });
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
loader,
|
loader,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue