Skip to content

Commit

Permalink
Try
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Oct 9, 2022
1 parent f3167ea commit e325500
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-plugin-zip.yml
@@ -1,7 +1,7 @@
name: Build Gutenberg Plugin Zip

on:
pull_request:
# pull_request:
push:
branches: [trunk]
workflow_dispatch:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bundle-size.yml
Expand Up @@ -35,6 +35,7 @@ jobs:
build:
name: Check
runs-on: ubuntu-latest
if: false

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-block.yml
@@ -1,7 +1,7 @@
name: Create Block

on:
pull_request:
# pull_request:
push:
branches: [trunk, wp/latest]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/end2end-test.yml
@@ -1,7 +1,7 @@
name: End-to-End Tests

on:
pull_request:
# pull_request:
push:
branches:
- trunk
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/flaky-tests.yml
Expand Up @@ -10,7 +10,8 @@ jobs:
report-to-issues:
name: Report to GitHub issues
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: false
steps:
# Checkout defaults to using the branch which triggered the event, which
# isn't necessarily `trunk` (e.g. in the case of a merge).
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/performance.yml
@@ -1,7 +1,7 @@
name: Performance Tests

on:
pull_request:
# pull_request:
release:
types: [published]
push:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request-automation.yml
@@ -1,6 +1,6 @@
on:
pull_request_target:
types: [opened]
# pull_request_target:
# types: [opened]
push:
name: Pull request automation

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rnmobile-android-runner.yml
@@ -1,7 +1,7 @@
name: React Native E2E Tests (Android)

on:
pull_request:
# pull_request:
push:
branches: [trunk]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rnmobile-ios-runner.yml
@@ -1,7 +1,7 @@
name: React Native E2E Tests (iOS)

on:
pull_request:
# pull_request:
push:
branches: [trunk]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-checks.yml
@@ -1,7 +1,7 @@
name: Static Analysis (Linting, License, Type checks...)

on:
pull_request:
# pull_request:
push:
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Expand Up @@ -3,7 +3,7 @@ name: Unit Tests
# Since Unit Tests are required to pass for each PR,
# we cannot disable them for documentation-only changes.
on:
pull_request:
# pull_request:
push:
branches:
- trunk
Expand Down
22 changes: 12 additions & 10 deletions packages/block-editor/src/components/inserter-list-item/index.js
Expand Up @@ -113,16 +113,18 @@ function InserterListItem( {
onBlur={ () => onHover( null ) }
{ ...props }
>
<span
className="block-editor-block-types-list__item-icon"
style={ itemIconStyle }
>
<BlockIcon icon={ item.icon } showColors />
</span>
<span className="block-editor-block-types-list__item-title">
<Truncate numberOfLines={ 3 }>
{ item.title }
</Truncate>
<span className="block-editor-block-types-list__item-container">
<span
className="block-editor-block-types-list__item-icon"
style={ itemIconStyle }
>
<BlockIcon icon={ item.icon } showColors />
</span>
<span className="block-editor-block-types-list__item-title">
<Truncate numberOfLines={ 3 }>
{ item.title }
</Truncate>
</span>
</span>
</InserterListboxItem>
</div>
Expand Down
Expand Up @@ -7,11 +7,10 @@

.components-button.block-editor-block-types-list__item {
display: flex;
flex-direction: column;
width: 100%;
font-size: $default-font-size;
color: $gray-900;
padding: $grid-unit-10;
padding: 0;
align-items: stretch;
justify-content: center;
cursor: pointer;
Expand All @@ -23,6 +22,13 @@
position: relative;
height: auto;

.block-editor-block-types-list__item-container {
display: flex;
width: 100%;
flex-direction: column;
padding: $grid-unit-10;
}

&:disabled {
opacity: 0.6;
cursor: default;
Expand Down
Expand Up @@ -142,6 +142,8 @@ export default function useBlockDropZone( {
getBlockListSettings( targetRootClientId )?.orientation
);

console.debug( 'dropTarget', targetIndex );

setTargetBlockIndex( targetIndex === undefined ? 0 : targetIndex );

if ( targetIndex !== undefined ) {
Expand Down
1 change: 1 addition & 0 deletions packages/compose/src/hooks/use-drop-zone/index.js
Expand Up @@ -140,6 +140,7 @@ export default function useDropZone( {
}

function onDragOver( /** @type {DragEvent} */ event ) {
console.debug( 'dragover', !! event.defaultPrevented );
// Only call onDragOver for the innermost hovered drop zones.
if ( ! event.defaultPrevented && onDragOverRef.current ) {
onDragOverRef.current( event );
Expand Down
7 changes: 2 additions & 5 deletions test/e2e/playwright.config.ts
Expand Up @@ -14,7 +14,7 @@ const config: PlaywrightTestConfig = {
reporter: process.env.CI
? [ [ 'github' ], [ './config/flaky-tests-reporter.ts' ] ]
: 'list',
forbidOnly: !! process.env.CI,
// forbidOnly: !! process.env.CI,
workers: 1,
retries: process.env.CI ? 2 : 0,
timeout: parseInt( process.env.TIMEOUT || '', 10 ) || 100_000, // Defaults to 100 seconds.
Expand Down Expand Up @@ -67,10 +67,7 @@ const config: PlaywrightTestConfig = {
},
{
name: 'firefox',
use: {
...devices[ 'Desktop Firefox' ],
headless: ! process.env.CI,
},
use: { ...devices[ 'Desktop Firefox' ] },
grep: /@firefox/,
grepInvert: /-firefox/,
},
Expand Down
15 changes: 11 additions & 4 deletions test/e2e/specs/editor/various/inserting-blocks.spec.js
Expand Up @@ -9,7 +9,7 @@ test.use( {
},
} );

test.describe( 'Inserting blocks (@firefox, @webkit)', () => {
test.describe.only( 'Inserting blocks (@firefox, @webkit)', () => {
test.beforeEach( async ( { admin } ) => {
await admin.createNewPost();
} );
Expand Down Expand Up @@ -97,11 +97,17 @@ test.describe( 'Inserting blocks (@firefox, @webkit)', () => {
<!-- /wp:heading -->` );
} );

test( 'cancels dragging blocks from the global inserter by pressing Escape', async ( {
test.only( 'cancels dragging blocks from the global inserter by pressing Escape', async ( {
page,
editor,
insertingBlocksUtils,
} ) => {
}, testInfo ) => {
page.on( 'console', ( message ) => {
if ( message.type() === 'debug' ) {
console.log( '⚠️⚠️⚠️', testInfo.project.name, message.text() );
}
} );

// We need a dummy block in place to display the drop indicator due to a bug.
// @see https://github.com/WordPress/gutenberg/issues/44064
await editor.insertBlock( {
Expand All @@ -125,7 +131,8 @@ test.describe( 'Inserting blocks (@firefox, @webkit)', () => {
);

await page.hover(
'role=listbox[name="Blocks"i] >> role=option[name="Heading"i]'
'role=listbox[name="Blocks"i] >> role=option[name="Heading"i]',
{ position: { x: 10, y: 10 } }
);
const paragraphBoundingBox = await paragraphBlock.boundingBox();

Expand Down

0 comments on commit e325500

Please sign in to comment.