This commit is contained in:
Albert Juhé Lluveras 2018-11-19 14:27:06 -06:00 committed by GitHub
parent 9938707970
commit 209a200e78
1 changed files with 6 additions and 6 deletions

View File

@ -26,18 +26,18 @@ const data = [
describe( 'Legend', () => {
test( 'should not disable any button if more than one is active', () => {
const topSellingProducts = mount( <Legend colorScheme={ colorScheme } data={ data } /> );
const legend = mount( <Legend colorScheme={ colorScheme } data={ data } /> );
expect( topSellingProducts.find( 'button' ).get( 0 ).props.disabled ).toBeFalsy();
expect( topSellingProducts.find( 'button' ).get( 1 ).props.disabled ).toBeFalsy();
expect( legend.find( 'button' ).get( 0 ).props.disabled ).toBeFalsy();
expect( legend.find( 'button' ).get( 1 ).props.disabled ).toBeFalsy();
} );
test( 'should disable the last active button', () => {
data[ 1 ].visible = false;
const topSellingProducts = mount( <Legend colorScheme={ colorScheme } data={ data } /> );
const legend = mount( <Legend colorScheme={ colorScheme } data={ data } /> );
expect( topSellingProducts.find( 'button' ).get( 0 ).props.disabled ).toBeTruthy();
expect( topSellingProducts.find( 'button' ).get( 1 ).props.disabled ).toBeFalsy();
expect( legend.find( 'button' ).get( 0 ).props.disabled ).toBeTruthy();
expect( legend.find( 'button' ).get( 1 ).props.disabled ).toBeFalsy();
} );
} );