Skip to content

Commit

Permalink
Reformat with Prettier 3.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Sep 18, 2023
1 parent 797395b commit 6fdb2a9
Show file tree
Hide file tree
Showing 66 changed files with 298 additions and 348 deletions.
4 changes: 2 additions & 2 deletions bin/packages/check-build-type-declaration-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async function checkUnverifiedDeclarationFiles() {
const packageDir = path.resolve( 'packages' );
const packageDirs = (
await fs.readdir( packageDir, { withFileTypes: true } )
)
)
.filter( ( dirent ) => dirent.isDirectory() )
.map( ( dirent ) => path.join( packageDir, dirent.name ) );

Expand All @@ -97,7 +97,7 @@ async function checkUnverifiedDeclarationFiles() {
: null
)
)
).filter( Boolean );
).filter( Boolean );

const tscResults = await Promise.allSettled(
declarations.map( typecheckDeclarations )
Expand Down
7 changes: 3 additions & 4 deletions bin/plugin/commands/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,9 @@ async function updatePackages( config ) {
);
const changelogFilesPublicPackages = changelogFiles.filter(
( changelogPath ) => {
const pkg = require( path.join(
path.dirname( changelogPath ),
'package.json'
) );
const pkg = require(
path.join( path.dirname( changelogPath ), 'package.json' )
);
return pkg.private !== true;
}
);
Expand Down
5 changes: 3 additions & 2 deletions packages/block-editor/src/components/colors/with-colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ const upperFirst = ( [ firstLetter, ...rest ] ) =>
*/
const withCustomColorPalette = ( colorsArray ) =>
createHigherOrderComponent(
( WrappedComponent ) => ( props ) =>
<WrappedComponent { ...props } colors={ colorsArray } />,
( WrappedComponent ) => ( props ) => (
<WrappedComponent { ...props } colors={ colorsArray } />
),
'withCustomColorPalette'
);

Expand Down
20 changes: 8 additions & 12 deletions packages/block-editor/src/components/inserter/test/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ describe( 'Inserter', () => {
fireEvent( addBlockButton, 'onLongPress' );

// Get Add To Beginning option
const addBlockToBeginningButton = await getByLabelText(
'Add To Beginning'
);
const addBlockToBeginningButton =
await getByLabelText( 'Add To Beginning' );
expect( addBlockToBeginningButton ).toBeVisible();
fireEvent.press( addBlockToBeginningButton );

Expand Down Expand Up @@ -97,9 +96,8 @@ describe( 'Inserter', () => {
fireEvent( addBlockButton, 'onLongPress' );

// Get Add Block Before option
const addBlockBeforeButton = await getByLabelText(
'Add Block Before'
);
const addBlockBeforeButton =
await getByLabelText( 'Add Block Before' );
expect( addBlockBeforeButton ).toBeVisible();
fireEvent.press( addBlockBeforeButton );

Expand Down Expand Up @@ -135,9 +133,8 @@ describe( 'Inserter', () => {
fireEvent( addBlockButton, 'onLongPress' );

// Get Add Block After option
const addBlockAfterButton = await getByLabelText(
'Add Block After'
);
const addBlockAfterButton =
await getByLabelText( 'Add Block After' );
expect( addBlockAfterButton ).toBeVisible();
fireEvent.press( addBlockAfterButton );

Expand Down Expand Up @@ -233,9 +230,8 @@ describe( 'Inserter', () => {
await addBlock( screen, 'Heading' );

// Select the title
const titleInputElement = await getAllByLabelText(
'Post title. test'
)[ 0 ];
const titleInputElement =
await getAllByLabelText( 'Post title. test' )[ 0 ];
expect( titleInputElement ).toBeVisible();
fireEvent.press( titleInputElement );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1218,9 +1218,8 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => {
// Resolve the `createSuggestion` promise.
resolver();

const currentLink = await screen.findByLabelText(
'Currently selected'
);
const currentLink =
await screen.findByLabelText( 'Currently selected' );

expect( currentLink ).toHaveTextContent( entityNameText );
expect( currentLink ).toHaveTextContent( '/?p=123' );
Expand Down
7 changes: 4 additions & 3 deletions packages/block-editor/src/hooks/test/align.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ describe( 'Align options', () => {
expect( groupBlock ).toBeVisible();

// Trigger inner blocks layout
const innerBlockListWrapper = await within(
groupBlock
).findByTestId( 'block-list-wrapper' );
const innerBlockListWrapper =
await within( groupBlock ).findByTestId(
'block-list-wrapper'
);
fireEvent( innerBlockListWrapper, 'layout', {
nativeEvent: {
layout: {
Expand Down
5 changes: 2 additions & 3 deletions packages/block-library/src/block/test/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,8 @@ describe( 'Synced patterns', () => {
/Pattern Block\. Row 1/
);

const innerBlockListWrapper = await within(
reusableBlock
).findByTestId( 'block-list-wrapper' );
const innerBlockListWrapper =
await within( reusableBlock ).findByTestId( 'block-list-wrapper' );

// onLayout event has to be explicitly dispatched in BlockList component,
// otherwise the inner blocks are not rendered.
Expand Down
52 changes: 28 additions & 24 deletions packages/block-library/src/buttons/test/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ describe( 'Buttons block', () => {

// onLayout event has to be explicitly dispatched in BlockList component,
// otherwise the inner blocks are not rendered.
const innerBlockListWrapper = await within(
buttonsBlock
).findByTestId( 'block-list-wrapper' );
const innerBlockListWrapper =
await within( buttonsBlock ).findByTestId(
'block-list-wrapper'
);
fireEvent( innerBlockListWrapper, 'layout', {
nativeEvent: {
layout: {
Expand All @@ -66,19 +67,18 @@ describe( 'Buttons block', () => {
},
} );

const [ buttonInnerBlock ] = await within(
buttonsBlock
).findAllByLabelText( /Button Block\. Row 1/ );
const [ buttonInnerBlock ] =
await within( buttonsBlock ).findAllByLabelText(
/Button Block\. Row 1/
);
fireEvent.press( buttonInnerBlock );

const settingsButton = await editor.findByLabelText(
'Open Settings'
);
const settingsButton =
await editor.findByLabelText( 'Open Settings' );
fireEvent.press( settingsButton );

const radiusStepper = await editor.findByLabelText(
/Border Radius/
);
const radiusStepper =
await editor.findByLabelText( /Border Radius/ );

const incrementButton = await within( radiusStepper ).findByTestId(
'Increment',
Expand All @@ -98,9 +98,10 @@ describe( 'Buttons block', () => {
const buttonsBlock = await getBlock( screen, 'Buttons' );

// Trigger inner blocks layout
const innerBlockListWrapper = await within(
buttonsBlock
).findByTestId( 'block-list-wrapper' );
const innerBlockListWrapper =
await within( buttonsBlock ).findByTestId(
'block-list-wrapper'
);
fireEvent( innerBlockListWrapper, 'layout', {
nativeEvent: {
layout: {
Expand All @@ -119,9 +120,10 @@ describe( 'Buttons block', () => {
fireEvent.press( appenderButton );

// Check for new button
const [ secondButtonBlock ] = await within(
buttonsBlock
).findAllByLabelText( /Button Block\. Row 2/ );
const [ secondButtonBlock ] =
await within( buttonsBlock ).findAllByLabelText(
/Button Block\. Row 2/
);
expect( secondButtonBlock ).toBeVisible();

// Add a Paragraph block using the empty placeholder at the bottom
Expand All @@ -148,9 +150,10 @@ describe( 'Buttons block', () => {
fireEvent.press( buttonsBlock );

// Trigger inner blocks layout
const innerBlockListWrapper = await within(
buttonsBlock
).findByTestId( 'block-list-wrapper' );
const innerBlockListWrapper =
await within( buttonsBlock ).findByTestId(
'block-list-wrapper'
);
fireEvent( innerBlockListWrapper, 'layout', {
nativeEvent: {
layout: {
Expand Down Expand Up @@ -207,9 +210,10 @@ describe( 'Buttons block', () => {
const buttonsBlock = await getBlock( screen, 'Buttons' );

// Trigger inner blocks layout
const innerBlockListWrapper = await within(
buttonsBlock
).findByTestId( 'block-list-wrapper' );
const innerBlockListWrapper =
await within( buttonsBlock ).findByTestId(
'block-list-wrapper'
);
fireEvent( innerBlockListWrapper, 'layout', {
nativeEvent: {
layout: {
Expand Down
45 changes: 18 additions & 27 deletions packages/block-library/src/cover/test/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,8 @@ describe( 'when an image is attached', () => {
/>
);
fireEvent.press( screen.getByLabelText( 'Edit image' ) );
const [ clearMediaButton ] = await screen.findAllByText(
'Clear Media'
);
const [ clearMediaButton ] =
await screen.findAllByText( 'Clear Media' );
fireEvent.press( clearMediaButton );

expect( setAttributes ).toHaveBeenCalledWith(
Expand All @@ -191,9 +190,8 @@ describe( 'when an image is attached', () => {
setAttributes={ setAttributes }
/>
);
const fixedBackgroundButton = await screen.findByText(
'Fixed background'
);
const fixedBackgroundButton =
await screen.findByText( 'Fixed background' );
fireEvent.press( fixedBackgroundButton );

expect( setAttributes ).toHaveBeenCalledWith(
Expand All @@ -210,9 +208,8 @@ describe( 'when an image is attached', () => {
setAttributes={ setAttributes }
/>
);
const editFocalPointButton = await screen.findByText(
'Edit focal point'
);
const editFocalPointButton =
await screen.findByText( 'Edit focal point' );
fireEvent.press( editFocalPointButton );
fireEvent(
screen.getByTestId( 'Slider Y-Axis Position', { hidden: true } ),
Expand All @@ -239,9 +236,8 @@ describe( 'when an image is attached', () => {
setAttributes={ setAttributes }
/>
);
const editFocalPointButton = await screen.findByText(
'Edit focal point'
);
const editFocalPointButton =
await screen.findByText( 'Edit focal point' );
fireEvent.press( editFocalPointButton );
fireEvent.press(
screen.getByText( ( attributes.focalPoint.x * 100 ).toString(), {
Expand All @@ -268,9 +264,8 @@ describe( 'when an image is attached', () => {
setAttributes={ setAttributes }
/>
);
const editFocalPointButton = await screen.findByText(
'Edit focal point'
);
const editFocalPointButton =
await screen.findByText( 'Edit focal point' );
fireEvent.press( editFocalPointButton );
fireEvent.press(
screen.getByText( ( attributes.focalPoint.x * 100 ).toString(), {
Expand Down Expand Up @@ -360,9 +355,8 @@ describe( 'color settings', () => {
fireEvent.press( colorButton );

// Wait for the block to be created.
const [ coverBlockWithOverlay ] = await screen.findAllByLabelText(
/Cover Block\. Row 1/
);
const [ coverBlockWithOverlay ] =
await screen.findAllByLabelText( /Cover Block\. Row 1/ );
fireEvent.press( coverBlockWithOverlay );

// Open Block Settings.
Expand Down Expand Up @@ -399,9 +393,8 @@ describe( 'color settings', () => {
} );

// Wait for the block to be created.
const [ coverBlock ] = await screen.findAllByLabelText(
/Cover Block\. Row 1/
);
const [ coverBlock ] =
await screen.findAllByLabelText( /Cover Block\. Row 1/ );
fireEvent.press( coverBlock );

// Open Block Settings.
Expand Down Expand Up @@ -455,9 +448,8 @@ describe( 'color settings', () => {
fireEvent.press( colorButton );

// Wait for the block to be created.
const [ coverBlockWithOverlay ] = await screen.findAllByLabelText(
/Cover Block\. Row 1/
);
const [ coverBlockWithOverlay ] =
await screen.findAllByLabelText( /Cover Block\. Row 1/ );
fireEvent.press( coverBlockWithOverlay );

// Open Block Settings.
Expand Down Expand Up @@ -511,9 +503,8 @@ describe( 'color settings', () => {
} );

// Wait for the block to be created.
const [ coverBlock ] = await screen.findAllByLabelText(
/Cover Block\. Row 1/
);
const [ coverBlock ] =
await screen.findAllByLabelText( /Cover Block\. Row 1/ );
fireEvent.press( coverBlock );

// Open Block Settings.
Expand Down

0 comments on commit 6fdb2a9

Please sign in to comment.