Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 6d549da

Browse files
committed
Fix last test names and comments regarding password/encryption key
1 parent 790d2b1 commit 6d549da

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

nodecg-io-core/extension/__tests__/persistenceManager.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ describe("PersistenceManager", () => {
7979
expect(persistenceManager.checkEncryptionKey(validEncryptionKey)).toBe(false);
8080
});
8181

82-
test("should return false if loaded but password is wrong", async () => {
82+
test("should return false if loaded but encryption key is wrong", async () => {
8383
await persistenceManager.load(validEncryptionKey);
8484
expect(persistenceManager.checkEncryptionKey(invalidEncryptionKey)).toBe(false);
8585
});
8686

87-
test("should return true if loaded and password is correct", async () => {
87+
test("should return true if loaded and encryption key is correct", async () => {
8888
await persistenceManager.load(validEncryptionKey);
8989
expect(persistenceManager.checkEncryptionKey(validEncryptionKey)).toBe(true);
9090
});
@@ -97,14 +97,14 @@ describe("PersistenceManager", () => {
9797

9898
test("should return false if load was called but failed", async () => {
9999
encryptedDataReplicant.value = generateEncryptedConfig();
100-
const res = await persistenceManager.load(invalidEncryptionKey); // Will fail because the password is invalid
100+
const res = await persistenceManager.load(invalidEncryptionKey); // Will fail because the encryption key is invalid
101101
expect(res.failed).toBe(true);
102102
expect(persistenceManager.isLoaded()).toBe(false);
103103
});
104104

105105
test("should return true if load was called and succeeded", async () => {
106106
encryptedDataReplicant.value = generateEncryptedConfig();
107-
const res = await persistenceManager.load(validEncryptionKey); // password is correct, should work
107+
const res = await persistenceManager.load(validEncryptionKey); // encryption key is correct, should work
108108
expect(res.failed).toBe(false);
109109
expect(persistenceManager.isLoaded()).toBe(true);
110110
});
@@ -143,15 +143,15 @@ describe("PersistenceManager", () => {
143143
expect(encryptedDataReplicant.value.cipherText).toBeDefined();
144144
});
145145

146-
test("should error if password is wrong", async () => {
146+
test("should error if encryption key is wrong", async () => {
147147
const res = await persistenceManager.load(invalidEncryptionKey);
148148
expect(res.failed).toBe(true);
149149
if (res.failed) {
150150
expect(res.errorMessage).toContain("Password isn't correct");
151151
}
152152
});
153153

154-
test("should succeed if password is correct", async () => {
154+
test("should succeed if encryption key is correct", async () => {
155155
const res = await persistenceManager.load(validEncryptionKey);
156156
expect(res.failed).toBe(false);
157157
});
@@ -402,7 +402,7 @@ describe("PersistenceManager", () => {
402402
});
403403

404404
test("should automatically save if BundleManager or InstanceManager emit a change event", async () => {
405-
await persistenceManager.load(validEncryptionKey); // Set password so that we can save stuff
405+
await persistenceManager.load(validEncryptionKey); // Set encryption key so that we can save stuff
406406

407407
encryptedDataReplicant.value.cipherText = undefined;
408408
bundleManager.emit("change");

0 commit comments

Comments
 (0)