Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CSS class for a product's disabled button #681

Merged
merged 1 commit into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/product.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export default class Product extends Component {
}

get buttonClass() {
const disabledClass = this.buttonEnabled ? '' : this.classes.disabled;
const disabledClass = this.buttonEnabled ? '' : this.classes.product.disabled;
const quantityClass = this.options.contents.buttonWithQuantity ? this.classes.product.buttonBesideQty : '';
return `${disabledClass} ${quantityClass}`;
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/product/product-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -1680,12 +1680,12 @@ describe('Product Component class', () => {

it('contains disabled class if button is not enabled', () => {
product.buttonEnabled = false;
assert.include(product.buttonClass, product.classes.disabled);
assert.include(product.buttonClass, product.classes.product.disabled);
});

it('does not contain disabled class if button is enabled', () => {
product.buttonEnabled = true;
assert.notInclude(product.buttonClass, product.classes.disabled);
assert.notInclude(product.buttonClass, product.classes.product.disabled);
});

it('contains buttonBesideQty class if button has quantity', () => {
Expand Down