This commit is contained in:
Jill Regan
2026-06-17 10:56:39 -04:00
parent 398aa5d1ea
commit dbef05db1e
+8 -2
View File
@@ -77,6 +77,12 @@ describe("loadSecretsFromSDK", () => {
); );
}); });
it("masks the integration key and strips its base64 padding", async () => {
await loadSecretsFromSDK(workloadId, environmentId, "integration-key==", false);
expect(core.setSecret).toHaveBeenCalledWith("integration-key");
});
describe("when secret value is empty string", () => { describe("when secret value is empty string", () => {
beforeEach(() => { beforeEach(() => {
mockGetVariables.mockResolvedValue({ mockGetVariables.mockResolvedValue({
@@ -93,14 +99,14 @@ describe("loadSecretsFromSDK", () => {
); );
expect(core.setOutput).toHaveBeenCalledWith("EMPTY_SECRET", ""); expect(core.setOutput).toHaveBeenCalledWith("EMPTY_SECRET", "");
expect(core.setSecret).not.toHaveBeenCalled(); expect(core.setSecret).not.toHaveBeenCalledWith("");
}); });
it("sets empty string as environment variable", async () => { it("sets empty string as environment variable", async () => {
await loadSecretsFromSDK(workloadId, environmentId, integrationKey, true); await loadSecretsFromSDK(workloadId, environmentId, integrationKey, true);
expect(core.exportVariable).toHaveBeenCalledWith("EMPTY_SECRET", ""); expect(core.exportVariable).toHaveBeenCalledWith("EMPTY_SECRET", "");
expect(core.setSecret).not.toHaveBeenCalled(); expect(core.setSecret).not.toHaveBeenCalledWith("");
}); });
}); });