fix: show popup on successful template build (#19674)

Fixes: https://github.com/coder/coder/issues/18364
This commit is contained in:
Marcin Tojek
2025-09-03 09:23:37 +02:00
committed by GitHub
parent 18945a7949
commit d415964b9f
2 changed files with 7 additions and 1 deletions
@@ -21,7 +21,7 @@ import {
TopbarDivider,
TopbarIconButton,
} from "components/FullPageLayout/Topbar";
import { displayError } from "components/GlobalSnackbar/utils";
import { displayError, displaySuccess } from "components/GlobalSnackbar/utils";
import { Loader } from "components/Loader/Loader";
import {
ChevronLeftIcon,
@@ -185,6 +185,9 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
templateVersion.job.status === "succeeded"
) {
setDirty(false);
displaySuccess(
`Template version "${previousVersion.current.name}" built successfully.`,
);
}
previousVersion.current = templateVersion;
}, [templateVersion]);
@@ -104,6 +104,9 @@ const buildTemplateVersion = async (
});
await user.click(buildButton);
await within(topbar).findByText("Success");
await screen.findByText(
`Template version "${templateVersion.name}" built successfully.`,
);
};
test("Use custom name, message and set it as active when publishing", async () => {