diff --git a/packages/builder/cypress/integration/renameAnApplication.spec.js b/packages/builder/cypress/integration/renameAnApplication.spec.js index 95a152c017..a954faee95 100644 --- a/packages/builder/cypress/integration/renameAnApplication.spec.js +++ b/packages/builder/cypress/integration/renameAnApplication.spec.js @@ -10,7 +10,7 @@ it("should rename an unpublished application", () => { cy.get(".home-logo").click() renameApp(appRename) cy.searchForApplication(appRename) - cy.get(".appGrid").find(".wrapper").should("have.length", 1) + cy.get(".appTable").find(".title").should("have.length", 1) cy.deleteApp(appRename) }) @@ -29,7 +29,7 @@ xit("Should rename a published application", () => { cy.get(".home-logo").click() renameApp(appRename, true) cy.searchForApplication(appRename) - cy.get(".appGrid").find(".wrapper").should("have.length", 1) + cy.get(".appTable").find(".title").should("have.length", 1) }) it("Should try to rename an application to have no name", () => { @@ -38,7 +38,7 @@ it("Should try to rename an application to have no name", () => { // Close modal and confirm name has not been changed cy.get(".spectrum-Dialog-grid").contains("Cancel").click() cy.searchForApplication("Cypress Tests") - cy.get(".appGrid").find(".wrapper").should("have.length", 1) + cy.get(".appTable").find(".title").should("have.length", 1) }) xit("Should create two applications with the same name", () => { @@ -64,7 +64,7 @@ it("should validate application names", () => { cy.get(".home-logo").click() renameApp(numberName) cy.searchForApplication(numberName) - cy.get(".appGrid").find(".wrapper").should("have.length", 1) + cy.get(".appTable").find(".title").should("have.length", 1) renameApp(specialCharName) cy.get(".error").should("have.text", "App name must be letters, numbers and spaces only") }) @@ -74,14 +74,14 @@ it("should validate application names", () => { .its("body") .then(val => { if (val.length > 0) { - cy.get(".title > :nth-child(3) > .spectrum-Icon").click() + cy.get(".appTable > :nth-child(5) > :nth-child(2) > .spectrum-Icon").click() // Check for when an app is published if (published == true){ // Should not have Edit as option, will unpublish app cy.should("not.have.value", "Edit") cy.get(".spectrum-Menu").contains("Unpublish").click() cy.get(".spectrum-Dialog-grid").contains("Unpublish app").click() - cy.get(".title > :nth-child(3) > .spectrum-Icon").click() + cy.get(".appTable > :nth-child(5) > :nth-child(2) > .spectrum-Icon").click() } cy.contains("Edit").click() cy.get(".spectrum-Modal") diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 0870ceac7a..e67057344a 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -50,7 +50,9 @@ Cypress.Commands.add("deleteApp", appName => { .its("body") .then(val => { if (val.length > 0) { - cy.get(".title > :nth-child(3) > .spectrum-Icon").click() + cy.get( + ".appTable > :nth-child(5) > :nth-child(2) > .spectrum-Icon" + ).click() cy.contains("Delete").click() cy.get(".spectrum-Modal").within(() => { cy.get("input").type(appName) diff --git a/packages/builder/src/components/start/AppRow.svelte b/packages/builder/src/components/start/AppRow.svelte index 45ab065382..a3439275f2 100644 --- a/packages/builder/src/components/start/AppRow.svelte +++ b/packages/builder/src/components/start/AppRow.svelte @@ -9,6 +9,7 @@ } from "@budibase/bbui" import { apps } from "stores/portal" import { processStringSync } from "@budibase/string-templates" + export let app export let exportApp export let viewApp @@ -18,16 +19,19 @@ export let unpublishApp export let releaseLock export let editIcon - $: color = $apps.filter(filtered_app => app?.appId === filtered_app.appId)[0] - .icon?.color - $: name = $apps.filter(filtered_app => app?.appId === filtered_app.appId)[0] - .icon?.name + $: console.log($apps) + $: color = + $apps.find(filtered_app => app?.appId === filtered_app.appId)?.icon + ?.color || "" + $: name = + $apps.find(filtered_app => app?.appId === filtered_app.appId)?.icon?.name || + "Apps"