-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the first commit that switches the blockGap over to use to an…
… object. We're using the `top` and `left` properties of the BoxControl next value to represent row and column values. Reverting some block.json changes. Ensuring that we cater for blockGap string values. Reverting some block.json changes. Ensuring that we cater for blockGap string values. Adding tests.
- Loading branch information
Showing
9 changed files
with
143 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { getGapCSSValue } from '../gap'; | ||
|
||
describe( 'gap', () => { | ||
describe( 'getGapCSSValue()', () => { | ||
it( 'should return argument if argument is falsey', () => { | ||
expect( getGapCSSValue( undefined ) ).toBeUndefined(); | ||
} ); | ||
|
||
it( 'should return single value for gap if argument is valid string', () => { | ||
expect( getGapCSSValue( '88rem' ) ).toEqual( '88rem' ); | ||
} ); | ||
|
||
it( 'should return single value for gap if row and column are the same', () => { | ||
const blockGapValue = { | ||
top: '88rem', | ||
left: '88rem', | ||
}; | ||
expect( getGapCSSValue( blockGapValue ) ).toEqual( '88rem' ); | ||
} ); | ||
|
||
it( 'should return shorthand value for gap if row and column are different', () => { | ||
const blockGapValue = { | ||
top: '88px', | ||
left: '88rem', | ||
}; | ||
expect( getGapCSSValue( blockGapValue ) ).toEqual( '88px 88rem' ); | ||
} ); | ||
|
||
it( 'should return default value if a top or left is missing', () => { | ||
const blockGapValue = { | ||
top: '88px', | ||
}; | ||
expect( getGapCSSValue( blockGapValue, '1px' ) ).toEqual( | ||
'88px 1px' | ||
); | ||
} ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters