From d85b47ac80a2343a921f572166360fc7d8f541c5 Mon Sep 17 00:00:00 2001 From: Breno Cota <106157862+brenocota-hotmart@users.noreply.github.com> Date: Tue, 20 Sep 2022 17:54:06 -0300 Subject: [PATCH 1/4] fix: sandbox not render another queries (#349) * fix: sandbox not render another queries * fixup! fix: sandbox not render another queries * re-trigger github workflow Co-authored-by: Breno Cota --- src/sandbox.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/sandbox.js b/src/sandbox.js index 009c5014..b307bc0f 100644 --- a/src/sandbox.js +++ b/src/sandbox.js @@ -124,6 +124,18 @@ function Sandbox() { ); } +function checkQuery(queries) { + const suggestions = Object.values(queries).filter(Boolean); + const suggestion = Object.values(queries).find(Boolean); + + const anotherSuggestion = suggestions.find( + (query) => + query?.queryName && !query.snippet?.startsWith('// sorry, I failed'), + ); + + return anotherSuggestion ? anotherSuggestion : suggestion; +} + function onSelectNode(node, { origin }) { // onSelectNode can be triggered after onMouseLeave has already been called. // This makes it impossible to clear hover state. That's why we maintain and @@ -138,7 +150,8 @@ function onSelectNode(node, { origin }) { rootNode: state.rootNode, }); - const suggestion = Object.values(queries).find(Boolean); + const suggestion = checkQuery(queries); + if (!suggestion) { return; } From 341e526d83a75eec6c2c238acbf645888d7a9c18 Mon Sep 17 00:00:00 2001 From: lx4r Date: Thu, 2 Mar 2023 21:52:27 +0100 Subject: [PATCH 2/4] chore: remove broken link to Firefox Extension (#359) --- src/components/Header.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/components/Header.js b/src/components/Header.js index e1327047..a8cef466 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -196,12 +196,6 @@ function Header({ > Chrome Extension - - Firefox Extension -
From e79a18cf232faaab31a5fc342076d1c7b568aa6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Soares?= Date: Thu, 2 Mar 2023 21:01:48 +0000 Subject: [PATCH 3/4] chore: remove link to a closed roadmap (#354) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Luís Soares --- src/components/Header.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/components/Header.js b/src/components/Header.js index a8cef466..1cbc4b7c 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -166,12 +166,6 @@ function Header({ - - Roadmap - Date: Thu, 2 Mar 2023 22:15:07 +0100 Subject: [PATCH 4/4] chore: remove roadmap link from specs (#361) --- cypress/e2e/header.spec.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/cypress/e2e/header.spec.js b/cypress/e2e/header.spec.js index 9f96b987..0ddfb519 100644 --- a/cypress/e2e/header.spec.js +++ b/cypress/e2e/header.spec.js @@ -43,7 +43,6 @@ it('renders Testing Playground Header', () => { cy.findByLabelText(/test-id attribute:/i).should('not.be.visible'); // more info menu shows - cy.findByRole('menuitem', { name: /roadmap/i }).should('exist').and('have.attr', 'href', 'https://github.com/testing-library/testing-playground/projects/1'); cy.findByRole('menuitem', { name: /github/i }).should('exist').and('have.attr', 'href', 'https://github.com/testing-library/testing-playground/issues'); cy.findByRole('menuitem', { name: /support us/i }).should('exist').and('have.attr', 'href', 'https://github.com/sponsors/smeijer'); cy.findByRole('menuitem', { name: /twitter/i }).should('exist').and('have.attr', 'href', 'https://twitter.com/meijer_s'); @@ -55,7 +54,6 @@ it('renders Testing Playground Header', () => { // click outside cy.findByRole('button', { name: /more info/i }).parent().click(); // previous menu disappear - cy.findByRole('menuitem', { name: /roadmap/i }).should('not.exist'); cy.findByRole('menuitem', { name: /github/i }).should('not.exist'); cy.findByRole('menuitem', { name: /support us/i }).should('not.exist'); cy.findByRole('menuitem', { name: /twitter/i }).should('not.exist');