From 83f4127ac4d98323691ef2461e70e25299e7023c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 29 Aug 2023 20:20:24 +0200 Subject: [PATCH] fix: Smart picker/code block tests after changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- cypress/e2e/SmartPicker.spec.js | 6 +++--- cypress/e2e/nodes/CodeBlock.spec.js | 4 ++-- src/components/Suggestion/LinkPicker/suggestions.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/SmartPicker.spec.js b/cypress/e2e/SmartPicker.spec.js index a6a0d4140a0..8a9fbab8355 100644 --- a/cypress/e2e/SmartPicker.spec.js +++ b/cypress/e2e/SmartPicker.spec.js @@ -31,14 +31,14 @@ describe('Smart picker', () => { }) cy.getContent() - .click() + .click({ force: true }) cy.getContent() .type('Heading{enter}Hello World{enter}') cy.getContent() .find('h1 [data-node-view-content]') - .should('have.text', 'Hello world') + .should('have.text', 'Hello World') }) it('Insert a link with the smart picker', () => { @@ -57,7 +57,7 @@ describe('Smart picker', () => { }) cy.getContent() - .click() + .click({ force: true }) cy.getContent() .type('{enter}') diff --git a/cypress/e2e/nodes/CodeBlock.spec.js b/cypress/e2e/nodes/CodeBlock.spec.js index 141e51eb017..14253b86ed8 100644 --- a/cypress/e2e/nodes/CodeBlock.spec.js +++ b/cypress/e2e/nodes/CodeBlock.spec.js @@ -45,7 +45,7 @@ describe('Front matter support', function() { // Remove language cy.getContent().find('.code-block').eq(1).find('.view-switch button').click() cy.get('.action-input__text-label').contains('Code block language') - cy.get('.input-field__input').clear() + cy.get('.input-field__input:visible').clear() cy.getContent().find('code').eq(1).click() @@ -54,7 +54,7 @@ describe('Front matter support', function() { // Re-add language cy.getContent().find('.code-block').eq(1).find('.view-switch button').click() cy.get('.action-input__text-label').contains('Code block language') - cy.get('.input-field__input').type('javascript') + cy.get('.input-field__input:visible').type('javascript') cy.getContent().find('code').eq(1).find('.hljs-keyword').eq(0).contains('const') cy.getContent().find('code').eq(1).find('.hljs-string').eq(0).contains('"bar"') diff --git a/src/components/Suggestion/LinkPicker/suggestions.js b/src/components/Suggestion/LinkPicker/suggestions.js index 402e8050766..8cf589a889a 100644 --- a/src/components/Suggestion/LinkPicker/suggestions.js +++ b/src/components/Suggestion/LinkPicker/suggestions.js @@ -87,7 +87,7 @@ export default () => createSuggestions({ icon: p.icon_url, providerId: p.id, } - }), + }).filter(e => e?.label?.toLowerCase?.()?.includes(query.toLowerCase())), ...formattingSuggestions(query) .filter(({ action, isActive }) => { const canRunState = action(editor?.can())