Skip to content

Commit

Permalink
Fix CSS class for a product's disabled button
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmaldi committed Apr 18, 2020
1 parent cc434a0 commit 399594c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 399594c

Please sign in to comment.