mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-09 21:32:38 +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>
|
||||
);
|
||||
}
|
||||
if (own) return null;
|
||||
if (own || source?.level === "builtin") return null;
|
||||
return (
|
||||
<span
|
||||
title={
|
||||
|
||||
@@ -54,6 +54,14 @@ describe("HostDefaultBadge", () => {
|
||||
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", () => {
|
||||
const value = context({ isOwn: () => true });
|
||||
withContext(value, <HostDefaultBadge settingKey="core.sshPort" />);
|
||||
|
||||
Reference in new issue
Block a user