Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
e2e tests for security
  • Loading branch information
mtojek committed Apr 15, 2024
commit 1daff361dd62e9899de7b86cf4b3d9c0ceef9fee
15 changes: 15 additions & 0 deletions site/e2e/tests/deployment/security.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { expect, test } from "@playwright/test";
import * as API from "api/api";
import { setupApiCalls } from "../../api";

test("enabled security settings", async ({ page }) => {
await setupApiCalls(page);

await page.goto("/deployment/security", { waitUntil: "domcontentloaded" });

// Load deployment settings
const config = await API.getDeploymentConfig();

// Check flags

});
7 changes: 6 additions & 1 deletion site/src/components/Badges/Badges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ const styles = {
} satisfies Record<string, Interpolation<Theme>>;

export const EnabledBadge: FC = () => {
return <span css={[styles.badge, styles.enabledBadge]}>Enabled</span>;
return (
<span css={[styles.badge, styles.enabledBadge]} className="option-enabled">
Enabled
</span>
);
};

export const EntitledBadge: FC = () => {
Expand Down Expand Up @@ -95,6 +99,7 @@ export const DisabledBadge: FC = forwardRef<
color: theme.experimental.l1.text,
}),
]}
className="option-disabled"
>
Disabled
</span>
Expand Down
24 changes: 20 additions & 4 deletions site/src/pages/DeploySettingsPage/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,27 @@ export const OptionValue: FC<OptionValueProps> = (props) => {
}

if (typeof value === "number") {
return <span css={styles.option}>{value}</span>;
return (
<span css={styles.option} className="option-value-number">
{value}
</span>
);
}

if (!value || value.length === 0) {
return <span css={styles.option}>Not set</span>;
return (
<span css={styles.option} className="option-value-empty">
Not set
</span>
);
}

if (typeof value === "string") {
return <span css={styles.option}>{value}</span>;
return (
<span css={styles.option} className="option-value-string">
{value}
</span>
);
}

if (typeof value === "object" && !Array.isArray(value)) {
Expand Down Expand Up @@ -104,7 +116,11 @@ export const OptionValue: FC<OptionValueProps> = (props) => {
);
}

return <span css={styles.option}>{JSON.stringify(value)}</span>;
return (
<span css={styles.option} className="option-value-json">
{JSON.stringify(value)}
</span>
);
};

type OptionConfigProps = HTMLAttributes<HTMLDivElement> & { isSource: boolean };
Expand Down