Skip to content

Commit

Permalink
Does not show borders in addon block inputs
Browse files Browse the repository at this point in the history
We made the css selector more generic, so that it can also be applied to
addon blocks
  • Loading branch information
wesleybl committed Mar 19, 2024
1 parent 482bced commit 22ab883
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 3 deletions.
25 changes: 25 additions & 0 deletions packages/volto/cypress/tests/core/blocks/blocks-slate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
describe('Slate Block Tests', () => {
beforeEach(() => {
cy.intercept('GET', `/**/*?expand*`).as('content');
cy.intercept('GET', '/**/Document').as('schema');

// given a logged in editor and a page in edit mode
cy.autologin();
cy.createContent({
contentType: 'Document',
contentId: 'my-page',
contentTitle: 'My Page',
});
cy.visit('/my-page');
cy.wait('@content');

cy.navigate('/my-page/edit');
cy.wait('@schema');
});

it('No border in input', () => {
cy.get('.block-editor-slate [role=textbox]')
.click()
.should('have.css', 'outline', 'rgba(0, 0, 0, 0.87) none 0px');
});
});
9 changes: 9 additions & 0 deletions packages/volto/cypress/tests/core/blocks/blocks-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,13 @@ describe('Table Block Tests', () => {
'.celled.fixed.table tbody tr:first-child() td:nth-child(2)',
).contains('column 2 / row 2');
});

it('No border in input', () => {
cy.addNewBlock('table');
cy.get('.block-editor-slateTable [role=textbox]').should('be.visible');
cy.get('.block-editor-slateTable [role=textbox]')
.first()
.click()
.should('have.css', 'outline', 'rgb(135, 143, 147) none 0px');
});
});
25 changes: 25 additions & 0 deletions packages/volto/cypress/tests/core/blocks/blocks-title.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
describe('Title Block Tests', () => {
beforeEach(() => {
cy.intercept('GET', `/**/*?expand*`).as('content');
cy.intercept('GET', '/**/Document').as('schema');

// given a logged in editor and a page in edit mode
cy.autologin();
cy.createContent({
contentType: 'Document',
contentId: 'my-page',
contentTitle: 'My Page',
});
cy.visit('/my-page');
cy.wait('@content');

cy.navigate('/my-page/edit');
cy.wait('@schema');
});

it('No border in input', () => {
cy.get('.block-editor-title [role=textbox]')
.click()
.should('have.css', 'outline', 'rgba(0, 0, 0, 0.87) none 0px');
});
});
1 change: 1 addition & 0 deletions packages/volto/news/5894.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Does not show borders in addon block inputs. @wesleybl
4 changes: 1 addition & 3 deletions packages/volto/theme/themes/pastanaga/extras/blocks.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
border-color: rgba(120, 192, 215, 0.75);
}

.block-editor-title,
.block-editor-slate,
.block-editor-slateTable,
[class^='block-editor-'],
.slate-editor.selected {
:focus-visible {
outline: none;
Expand Down

0 comments on commit 22ab883

Please sign in to comment.