Set button width.

This commit is contained in:
bmauger 2022-02-04 10:20:49 -05:00
parent 7ac3b40dbf
commit 1fdee10336
2 changed files with 34 additions and 0 deletions

View file

@ -57,4 +57,36 @@ describe("funnel-footer.vue", () => {
expect(input.attributes("class")).toContain("btn-primary");
});
it("Should return class justify-content-end if paddingHeight < 80px", async () => {
// Act
const wrapper = mount(funnelFooter, {
propsData: {
footer: true
},
});
// Assert
const stacked = wrapper.find("#stacked");
wrapper.vm.paddingHeight = 47;
// Expect
expect(stacked.attributes('class')).toContain("justify-content-end");
});
it("Should return class justify-content-start if paddingHeight > 80px", async () => {
// Act
const wrapper = mount(funnelFooter, {
propsData: {
footer: true
},
});
// Assert
const stacked = wrapper.find("#stacked");
wrapper.vm.paddingHeight = 100;
// Expect
expect(stacked.attributes('class')).toContain("justify-content-start");
});
});

View file

@ -69,6 +69,7 @@ export default {
setTimeout(function(){ // Give it a moment to set the date
document.getElementById('years').innerHTML += new Date().getFullYear();
}, 100);
this.checkHeight();
},
beforeUnmount() {
window.removeEventListener('resize', this.onResize);
@ -96,5 +97,6 @@ export default {
<style lang="scss">
button {
min-width: 200px;
width: 100%;
}
</style>