1
0
Fork 0
mirror of synced 2024-07-02 21:10:43 +12:00
budibase/packages/builder/cypress/integration/createScreen.js

42 lines
1.2 KiB
JavaScript
Raw Normal View History

import filterTests from "../support/filterTests"
2022-01-22 02:12:16 +13:00
filterTests(["smoke", "all"], () => {
context("Screen Tests", () => {
before(() => {
cy.login()
cy.createTestApp()
cy.navigateToFrontend()
})
it("Should successfully create a screen", () => {
2022-05-11 09:40:27 +12:00
cy.createScreen("test")
cy.get(".nav-items-container").within(() => {
cy.contains("/test").should("exist")
})
})
it("Should update the url", () => {
cy.createScreen("test with spaces")
cy.get(".nav-items-container").within(() => {
cy.contains("/test-with-spaces").should("exist")
})
})
2022-04-07 23:22:16 +12:00
2022-04-08 20:56:20 +12:00
it("Should create a blank screen with the selected access level", () => {
cy.createScreen("admin only", "Admin")
2022-04-08 20:56:20 +12:00
2022-04-07 23:22:16 +12:00
cy.get(".nav-items-container").within(() => {
cy.contains("/admin-only").should("exist")
})
2022-04-08 20:56:20 +12:00
cy.createScreen("open to all", "Public")
2022-04-08 20:56:20 +12:00
cy.get(".nav-items-container").within(() => {
cy.contains("/open-to-all").should("exist")
//The access level should now be set to admin. Previous screens should be filtered.
2022-04-08 21:31:04 +12:00
cy.get(".nav-item").contains("/test-screen").should("not.exist")
2022-04-08 20:56:20 +12:00
})
2022-04-07 23:22:16 +12:00
})
2022-01-22 02:12:16 +13:00
})
})