1
0
Fork 0
mirror of synced 2024-06-23 08:30:31 +12:00
This commit is contained in:
Martin McKeaveney 2020-11-20 11:41:17 +00:00
parent e369cbc6b3
commit 42d8a94f9a
5 changed files with 7 additions and 14 deletions

View file

@ -7,17 +7,7 @@ context('Screen Tests', () => {
cy.navigateToFrontend()
})
it('Should successful create a screen', () => {
it('Should successfully create a screen', () => {
cy.createScreen("test Screen", "/test")
})
it('Should rename a screen', () => {
cy.get(".components-pane").within(() => {
cy.contains("Settings").click()
cy.get("input[name=_instanceName]").clear().type("About Us").blur()
})
cy.get('.nav-items-container').within(() => {
cy.contains("About Us").should('exist')
})
})
})

View file

@ -166,6 +166,6 @@ Cypress.Commands.add("createScreen", (screenName, route) => {
cy.contains("Create Screen").click()
})
cy.get(".nav-items-container").within(() => {
cy.contains(screenName).should("exist")
cy.contains(route).should("exist")
})
})

View file

@ -36,7 +36,7 @@
indentLevel={indent || 1}
selected={$store.currentPreviewItem._id === screenId}
opened={$store.currentPreviewItem._id === screenId}
text={url === "/" ? "Home" : url}
text={url === '/' ? 'Home' : url}
withArrow={route.subpaths}
on:click={() => changeScreen(screenId)}>
<ScreenDropdownMenu screen={screenId} />

View file

@ -76,6 +76,7 @@
if (createLink) {
await store.actions.components.links.save(route, name)
}
await store.actions.routing.fetch()
if (templateIndex !== undefined) {
const template = templates[templateIndex]

View file

@ -43,7 +43,9 @@ export const screenRouter = ({ screens, onScreenSelected, window }) => {
return sanitize(url)
}
const routes = screens.map(screen => makeRootedPath(screen?.routing.route))
const routes = screens.map(screen =>
makeRootedPath(screen.routing ? screen.routing.route : null)
)
let fallback = routes.findIndex(([p]) => p === makeRootedPath("*"))
if (fallback < 0) fallback = 0