@wordpress/block-editor
Version:
36 lines (30 loc) • 1.06 kB
JavaScript
/**
* Internal dependencies
*/
import grid from '../grid';
describe( 'getLayoutStyle', () => {
it( 'should return only `grid-template-columns` and `container-type` properties if no non-default params are provided', () => {
const expected = `.my-container { grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr)); container-type: inline-size; }`;
const result = grid.getLayoutStyle( {
selector: '.my-container',
layout: {},
style: {},
blockName: 'test-block',
hasBlockGapSupport: false,
layoutDefinitions: undefined,
} );
expect( result ).toBe( expected );
} );
it( 'should return only `grid-template-columns` if columnCount property is provided', () => {
const expected = `.my-container { grid-template-columns: repeat(3, minmax(0, 1fr)); }`;
const result = grid.getLayoutStyle( {
selector: '.my-container',
layout: { columnCount: 3 },
style: {},
blockName: 'test-block',
hasBlockGapSupport: false,
layoutDefinitions: undefined,
} );
expect( result ).toBe( expected );
} );
} );