Merge pull request #227 from Safelite/BRM-button-bug-fix
Fix bug with button loader/spinner.
This commit is contained in:
commit
e1e3c6b5be
10 changed files with 6 additions and 123 deletions
|
|
@ -22,7 +22,6 @@
|
||||||
:selectingInitiatesLoad="selectingInitiatesLoad"
|
:selectingInitiatesLoad="selectingInitiatesLoad"
|
||||||
:loaderColor="loaderColor"
|
:loaderColor="loaderColor"
|
||||||
:loaderPosition="loaderPosition"
|
:loaderPosition="loaderPosition"
|
||||||
:sizeInRem="sizeInRem"
|
|
||||||
:isWide="isWide"
|
:isWide="isWide"
|
||||||
:isRequired="isRequired"
|
:isRequired="isRequired"
|
||||||
:buttonImage="answer.AnswerImageUrl"
|
:buttonImage="answer.AnswerImageUrl"
|
||||||
|
|
@ -74,10 +73,6 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: "right",
|
default: "right",
|
||||||
},
|
},
|
||||||
sizeInRem: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: 1.5,
|
|
||||||
},
|
|
||||||
isRequired: Boolean,
|
isRequired: Boolean,
|
||||||
isOverflowScrollable: Boolean,
|
isOverflowScrollable: Boolean,
|
||||||
isWide: Boolean,
|
isWide: Boolean,
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
isPrimary
|
isPrimary
|
||||||
:buttonText="buttonText"
|
:buttonText="buttonText"
|
||||||
loaderColor="white"
|
loaderColor="white"
|
||||||
sizeInRem="1"
|
|
||||||
:class="isDisabled && 'form-test-invalid'"
|
:class="isDisabled && 'form-test-invalid'"
|
||||||
:aria-disabled="isDisabled"
|
:aria-disabled="isDisabled"
|
||||||
:isDisabled="isDisabled"
|
:isDisabled="isDisabled"
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
isPrimary
|
isPrimary
|
||||||
buttonText="Primary"
|
buttonText="Primary"
|
||||||
loaderColor="white"
|
loaderColor="white"
|
||||||
sizeInRem="1"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
isPrimary
|
isPrimary
|
||||||
buttonText="Primary Disabled"
|
buttonText="Primary Disabled"
|
||||||
loaderColor="white"
|
loaderColor="white"
|
||||||
sizeInRem="1"
|
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
<buttonMain
|
<buttonMain
|
||||||
buttonText="Secondary"
|
buttonText="Secondary"
|
||||||
loaderColor="white"
|
loaderColor="white"
|
||||||
sizeInRem="1"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
<buttonMain
|
<buttonMain
|
||||||
buttonText="Secondary Disabled"
|
buttonText="Secondary Disabled"
|
||||||
loaderColor="white"
|
loaderColor="white"
|
||||||
sizeInRem="1"
|
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -390,7 +390,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -403,7 +402,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -416,7 +414,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<h6 class="mx-0 px-0 mt-4 mb-0 d-flex align-self-start">Checkbox with Error</h6>
|
<h6 class="mx-0 px-0 mt-4 mb-0 d-flex align-self-start">Checkbox with Error</h6>
|
||||||
|
|
@ -431,7 +428,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
hasError
|
hasError
|
||||||
/>
|
/>
|
||||||
|
|
@ -456,7 +452,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -468,7 +463,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -480,7 +474,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<h6 class="mx-0 px-0 mt-4 mb-0">Radio Button with Error</h6>
|
<h6 class="mx-0 px-0 mt-4 mb-0">Radio Button with Error</h6>
|
||||||
|
|
@ -494,7 +487,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
hasError
|
hasError
|
||||||
/>
|
/>
|
||||||
|
|
@ -525,7 +517,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -538,7 +529,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -551,7 +541,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -576,7 +565,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -588,7 +576,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -600,7 +587,6 @@
|
||||||
textPosition="text-start"
|
textPosition="text-start"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -633,7 +619,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -646,7 +631,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -659,7 +643,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -684,7 +667,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -696,7 +678,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
<listButton
|
<listButton
|
||||||
|
|
@ -708,7 +689,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -738,7 +718,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="1"
|
v-bind:positionInGroup="1"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
@ -752,7 +731,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="2"
|
v-bind:positionInGroup="2"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
@ -766,7 +744,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="3"
|
v-bind:positionInGroup="3"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
@ -793,7 +770,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="1"
|
v-bind:positionInGroup="1"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
@ -808,7 +784,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="2"
|
v-bind:positionInGroup="2"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
@ -823,7 +798,6 @@
|
||||||
textPosition="text-center"
|
textPosition="text-center"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="3"
|
v-bind:positionInGroup="3"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
@ -850,7 +824,6 @@
|
||||||
loaderEnabled="true"
|
loaderEnabled="true"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="1"
|
v-bind:positionInGroup="1"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
@ -864,7 +837,6 @@
|
||||||
loaderEnabled="true"
|
loaderEnabled="true"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="2"
|
v-bind:positionInGroup="2"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
@ -878,7 +850,6 @@
|
||||||
loaderEnabled="true"
|
loaderEnabled="true"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="3"
|
v-bind:positionInGroup="3"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
@ -905,7 +876,6 @@
|
||||||
loaderEnabled="true"
|
loaderEnabled="true"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="1"
|
v-bind:positionInGroup="1"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
@ -920,7 +890,6 @@
|
||||||
loaderEnabled="true"
|
loaderEnabled="true"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="2"
|
v-bind:positionInGroup="2"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
@ -935,7 +904,6 @@
|
||||||
loaderEnabled="true"
|
loaderEnabled="true"
|
||||||
loaderColor="blue"
|
loaderColor="blue"
|
||||||
loaderPosition="right"
|
loaderPosition="right"
|
||||||
sizeInRem="1"
|
|
||||||
v-bind:totalInGroup="3"
|
v-bind:totalInGroup="3"
|
||||||
v-bind:positionInGroup="3"
|
v-bind:positionInGroup="3"
|
||||||
screenReaderOnlyText=" opens new window"
|
screenReaderOnlyText=" opens new window"
|
||||||
|
|
|
||||||
|
|
@ -76,26 +76,4 @@ describe("buttonMain.vue", () => {
|
||||||
|
|
||||||
expect(loader.attributes("class")).toContain("right");
|
expect(loader.attributes("class")).toContain("right");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should return loader size in rem", async () => {
|
|
||||||
// Act
|
|
||||||
const wrapper = shallowMount(buttonMain, {
|
|
||||||
propsData: {
|
|
||||||
sizeInRem: 1,
|
|
||||||
loaderEnabled: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
|
|
||||||
const label = wrapper.find("label");
|
|
||||||
|
|
||||||
wrapper.vm.clicked();
|
|
||||||
|
|
||||||
await nextTick();
|
|
||||||
|
|
||||||
const loader = wrapper.find("loader-stub");
|
|
||||||
|
|
||||||
expect(loader.attributes("style")).toContain("1rem");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
<loader
|
<loader
|
||||||
class="ms-2"
|
class="ms-2"
|
||||||
v-if="isLoaderDisplayed"
|
v-if="isLoaderDisplayed"
|
||||||
v-bind:style="{ width: `${sizeInRem}rem`, height: `${sizeInRem}rem` }"
|
|
||||||
v-bind:class="[this.loaderColor, this.loaderPosition]"
|
v-bind:class="[this.loaderColor, this.loaderPosition]"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -25,7 +24,6 @@ export default {
|
||||||
isDisabled: Boolean,
|
isDisabled: Boolean,
|
||||||
loaderColor: String,
|
loaderColor: String,
|
||||||
loaderPosition: String,
|
loaderPosition: String,
|
||||||
sizeInRem: [Number, String],
|
|
||||||
isFloat: Boolean,
|
isFloat: Boolean,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
|
||||||
|
|
@ -155,29 +155,6 @@ describe("list-button-horizontal.vue", () => {
|
||||||
expect(loader.attributes("class")).toContain("right");
|
expect(loader.attributes("class")).toContain("right");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should return loader size in rem", async () => {
|
|
||||||
// Act
|
|
||||||
const wrapper = shallowMount(listButtonHorizontal, {
|
|
||||||
propsData: {
|
|
||||||
sizeInRem: 1,
|
|
||||||
selectingInitiatesLoad: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
|
|
||||||
const label = wrapper.find("label");
|
|
||||||
|
|
||||||
wrapper.vm.handleCheckChange = jest.fn();
|
|
||||||
wrapper.vm.handleClick();
|
|
||||||
|
|
||||||
await nextTick();
|
|
||||||
|
|
||||||
const loader = wrapper.find("loader-stub");
|
|
||||||
|
|
||||||
expect(loader.attributes("style")).toContain("1rem");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("Should emit button value on click", async () => {
|
it("Should emit button value on click", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listButtonHorizontal, {
|
const wrapper = shallowMount(listButtonHorizontal, {
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@
|
||||||
</span>
|
</span>
|
||||||
<loader
|
<loader
|
||||||
v-if="isLoaderDisplayed && !isMultiSelect"
|
v-if="isLoaderDisplayed && !isMultiSelect"
|
||||||
:style="{width: `${sizeInRem}rem`, height: `${sizeInRem}rem`}"
|
|
||||||
:class="[loaderColor, loaderPosition]"
|
:class="[loaderColor, loaderPosition]"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
|
@ -64,7 +63,6 @@ export default {
|
||||||
selectingInitiatesLoad: Boolean,
|
selectingInitiatesLoad: Boolean,
|
||||||
loaderColor: String,
|
loaderColor: String,
|
||||||
loaderPosition: String,
|
loaderPosition: String,
|
||||||
sizeInRem: [Number, String],
|
|
||||||
isRequired: Boolean,
|
isRequired: Boolean,
|
||||||
value: {
|
value: {
|
||||||
// Field initial value
|
// Field initial value
|
||||||
|
|
|
||||||
|
|
@ -153,29 +153,6 @@ describe("list-button.vue", () => {
|
||||||
expect(loader.attributes("class")).toContain("right");
|
expect(loader.attributes("class")).toContain("right");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should return loader size in rem", async () => {
|
|
||||||
// Act
|
|
||||||
const wrapper = shallowMount(listButton, {
|
|
||||||
propsData: {
|
|
||||||
sizeInRem: 1,
|
|
||||||
selectingInitiatesLoad: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
|
|
||||||
const label = wrapper.find("label");
|
|
||||||
|
|
||||||
wrapper.vm.handleCheckChange = jest.fn();
|
|
||||||
wrapper.vm.handleClick();
|
|
||||||
|
|
||||||
await nextTick();
|
|
||||||
|
|
||||||
const loader = wrapper.find("loader-stub");
|
|
||||||
|
|
||||||
expect(loader.attributes("style")).toContain("1rem");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("Should emit button value on click", async () => {
|
it("Should emit button value on click", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listButton, {
|
const wrapper = shallowMount(listButton, {
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@
|
||||||
</span>
|
</span>
|
||||||
<loader
|
<loader
|
||||||
v-if="isLoaderDisplayed && !isMultiSelect"
|
v-if="isLoaderDisplayed && !isMultiSelect"
|
||||||
:style="{ width: `${sizeInRem}rem`, height: `${sizeInRem}rem` }"
|
|
||||||
:class="[this.loaderColor, this.loaderPosition]"
|
:class="[this.loaderColor, this.loaderPosition]"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
|
@ -67,7 +66,6 @@ export default {
|
||||||
selectingInitiatesLoad: Boolean,
|
selectingInitiatesLoad: Boolean,
|
||||||
loaderColor: String,
|
loaderColor: String,
|
||||||
loaderPosition: String,
|
loaderPosition: String,
|
||||||
sizeInRem: [Number,String],
|
|
||||||
value: {
|
value: {
|
||||||
// Field initial value
|
// Field initial value
|
||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
class="loader"
|
class="loader"
|
||||||
role="alert"
|
role="alert"
|
||||||
aria-label="Loading new page"
|
aria-label="Loading new page"
|
||||||
v-bind:style="{ width: `${sizeInRem}rem`, height: `${sizeInRem}rem` }"
|
|
||||||
v-bind:class="[this.loaderColor, this.loaderPosition]"
|
v-bind:class="[this.loaderColor, this.loaderPosition]"
|
||||||
></div>
|
></div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -13,10 +12,6 @@ export default {
|
||||||
name: "loader",
|
name: "loader",
|
||||||
/* Specify size in number value which translates to rem value. For example, 1.5 = 1.5rem = 24px */
|
/* Specify size in number value which translates to rem value. For example, 1.5 = 1.5rem = 24px */
|
||||||
props: {
|
props: {
|
||||||
sizeInRem: {
|
|
||||||
type: Number,
|
|
||||||
default: 1,
|
|
||||||
},
|
|
||||||
/* Color options: red, green, blue, white, black */
|
/* Color options: red, green, blue, white, black */
|
||||||
loaderColor: {
|
loaderColor: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -50,8 +45,8 @@ export default {
|
||||||
mask: url(../../assets/img/icons/spinner.svg);
|
mask: url(../../assets/img/icons/spinner.svg);
|
||||||
mask-size: cover;
|
mask-size: cover;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 1rem;
|
||||||
height: 100%;
|
height: 1rem;
|
||||||
animation: rotation 1s infinite linear;
|
animation: rotation 1s infinite linear;
|
||||||
@keyframes rotation {
|
@keyframes rotation {
|
||||||
100% {
|
100% {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue