mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 07:05:24 +00:00
fix: hide the built-in source pill in the host editor
This commit is contained in:
1 parent
f97f35de1f
commit
c28cb1bfc6
2 files changed
+9
-1
No files matched your search
@@ -111,7 +111,7 @@ export function HostDefaultBadge({ settingKey }: { settingKey: string }) {
|
|||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (own) return null;
|
if (own || source?.level === "builtin") return null;
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
title={
|
title={
|
||||||
|
|||||||
@@ -54,6 +54,14 @@ describe("HostDefaultBadge", () => {
|
|||||||
expect(screen.getByText("hostDefaults.source.folder:Prod")).toBeTruthy();
|
expect(screen.getByText("hostDefaults.source.folder:Prod")).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("shows nothing for a value that follows the built-in default", () => {
|
||||||
|
const { container } = withContext(
|
||||||
|
context({ source: () => ({ level: "builtin" }) }),
|
||||||
|
<HostDefaultBadge settingKey="core.sshPort" />,
|
||||||
|
);
|
||||||
|
expect(container.textContent).toBe("");
|
||||||
|
});
|
||||||
|
|
||||||
it("offers a reset for a host's own value", () => {
|
it("offers a reset for a host's own value", () => {
|
||||||
const value = context({ isOwn: () => true });
|
const value = context({ isOwn: () => true });
|
||||||
withContext(value, <HostDefaultBadge settingKey="core.sshPort" />);
|
withContext(value, <HostDefaultBadge settingKey="core.sshPort" />);
|
||||||
|
|||||||
Reference in new issue
Block a user