mirror of
https://github.com/1Password/load-secrets-action.git
synced 2026-06-21 22:29:19 +00:00
Fix test
This commit is contained in:
@@ -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("");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user