feat: code split branding helpers, add auth locators in CE (#26379)
This commit is contained in:
parent
21ee27462d
commit
1aef2225aa
|
|
@ -2,13 +2,6 @@ const EnterpriseAdminSettingsLocators = require("../../../../locators/Enterprise
|
|||
import adminsSettings from "../../../../locators/AdminsSettings";
|
||||
import { REPO, CURRENT_REPO } from "../../../../fixtures/REPO";
|
||||
|
||||
function stubPricingPage() {
|
||||
cy.window().then((win) => {
|
||||
cy.stub(win, "open", (url) => {
|
||||
win.location.href = "https://www.appsmith.com/pricing?";
|
||||
}).as("pricingPage");
|
||||
});
|
||||
}
|
||||
describe("Admin settings page", function () {
|
||||
beforeEach(() => {
|
||||
cy.intercept("GET", "/api/v1/admin/env", {
|
||||
|
|
@ -34,7 +27,7 @@ describe("Admin settings page", function () {
|
|||
cy.get(adminsSettings.authenticationTab).click();
|
||||
cy.url().should("contain", "/settings/authentication");
|
||||
if (CURRENT_REPO === REPO.CE) {
|
||||
stubPricingPage();
|
||||
cy.stubPricingPage();
|
||||
cy.get(EnterpriseAdminSettingsLocators.upgradeOidcButton)
|
||||
.should("be.visible")
|
||||
.should("contain", "Upgrade")
|
||||
|
|
@ -42,7 +35,7 @@ describe("Admin settings page", function () {
|
|||
cy.get("@pricingPage").should("be.called");
|
||||
cy.wait(2000);
|
||||
cy.go(-1);
|
||||
stubPricingPage();
|
||||
cy.stubPricingPage();
|
||||
cy.get(EnterpriseAdminSettingsLocators.upgradeSamlButton)
|
||||
.should("be.visible")
|
||||
.should("contain", "Upgrade")
|
||||
|
|
@ -50,7 +43,7 @@ describe("Admin settings page", function () {
|
|||
cy.get("@pricingPage").should("be.called");
|
||||
cy.wait(2000);
|
||||
cy.go(-1);
|
||||
stubPricingPage();
|
||||
cy.stubPricingPage();
|
||||
cy.get(".t--settings-category-branding").click();
|
||||
cy.url().should("contain", "/settings/branding");
|
||||
cy.get(adminsSettings.brandingSubmitButton).should("be.disabled");
|
||||
|
|
@ -71,7 +64,7 @@ describe("Admin settings page", function () {
|
|||
});
|
||||
cy.get(adminsSettings.accessControl).click();
|
||||
cy.url().should("contain", "/settings/access-control");
|
||||
stubPricingPage();
|
||||
cy.stubPricingPage();
|
||||
cy.xpath(adminsSettings.upgrade).click();
|
||||
cy.get("@pricingPage").should("be.called");
|
||||
cy.wait(2000);
|
||||
|
|
@ -83,7 +76,7 @@ describe("Admin settings page", function () {
|
|||
});
|
||||
cy.get(adminsSettings.auditLogs).click();
|
||||
cy.url().should("contain", "/settings/audit-logs");
|
||||
stubPricingPage();
|
||||
cy.stubPricingPage();
|
||||
cy.xpath(adminsSettings.upgrade).click();
|
||||
cy.get("@pricingPage").should("be.called");
|
||||
cy.wait(2000);
|
||||
|
|
@ -95,7 +88,7 @@ describe("Admin settings page", function () {
|
|||
});
|
||||
cy.get(adminsSettings.provisioning).click();
|
||||
cy.url().should("contain", "/settings/provisioning");
|
||||
stubPricingPage();
|
||||
cy.stubPricingPage();
|
||||
cy.xpath(adminsSettings.upgrade).click();
|
||||
cy.get("@pricingPage").should("be.called");
|
||||
cy.wait(2000);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"upgradeSamlButton": ".t--settings-sub-category-upgrade-saml",
|
||||
"upgradeOidcButton": ".t--settings-sub-category-upgrade-oidc",
|
||||
"upgradeSamlButton": ".t--settings-sub-category-upgrade-saml-auth",
|
||||
"upgradeOidcButton": ".t--settings-sub-category-upgrade-oidc-auth",
|
||||
"hideAppsmithWatermarkSetting": ".admin-settings-group-APPSMITH_HIDE_WATERMARK"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2185,3 +2185,11 @@ Cypress.Commands.add("SelectFromMultiSelect", (options) => {
|
|||
Cypress.Commands.add("skipSignposting", () => {
|
||||
onboarding.closeIntroModal();
|
||||
});
|
||||
|
||||
Cypress.Commands.add("stubPricingPage", () => {
|
||||
cy.window().then((win) => {
|
||||
cy.stub(win, "open", (url) => {
|
||||
win.location.href = "https://www.appsmith.com/pricing?";
|
||||
}).as("pricingPage");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ export const GithubAuthCallout: AuthMethodType = {
|
|||
|
||||
export const SamlAuthCallout: AuthMethodType = {
|
||||
id: "APPSMITH_SAML_AUTH",
|
||||
category: "saml",
|
||||
category: SettingCategories.SAML_AUTH,
|
||||
label: "SAML 2.0",
|
||||
subText: createMessage(SAML_AUTH_DESC),
|
||||
image: SamlSso,
|
||||
|
|
@ -232,7 +232,7 @@ export const SamlAuthCallout: AuthMethodType = {
|
|||
|
||||
export const OidcAuthCallout: AuthMethodType = {
|
||||
id: "APPSMITH_OIDC_AUTH",
|
||||
category: "oidc",
|
||||
category: SettingCategories.OIDC_AUTH,
|
||||
label: "OIDC",
|
||||
subText: createMessage(OIDC_AUTH_DESC),
|
||||
image: OIDC,
|
||||
|
|
|
|||
|
|
@ -114,6 +114,8 @@ export const SettingCategories = {
|
|||
ACCESS_CONTROL: "access-control",
|
||||
PROVISIONING: "provisioning",
|
||||
BRANDING: "branding",
|
||||
SAML_AUTH: "saml-auth",
|
||||
OIDC_AUTH: "oidc-auth",
|
||||
};
|
||||
|
||||
export enum CategoryType {
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
export * from "ce/utils/BusinessFeatures/brandingPageHelpers";
|
||||
|
|
@ -9,7 +9,7 @@ import { Wrapper } from "@appsmith/pages/AdminSettings/config/authentication/Aut
|
|||
|
||||
import { getAssetUrl } from "@appsmith/utils/airgapHelpers";
|
||||
import type { AdminConfigType } from "@appsmith/pages/AdminSettings/config/types";
|
||||
import { getUpgradeBanner } from "utils/BusinessFeatures/brandingPageHelpers";
|
||||
import { getUpgradeBanner } from "@appsmith/utils/BusinessFeatures/brandingPageHelpers";
|
||||
|
||||
export type brandColorsKeys =
|
||||
| "primary"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user