test: tighten oauth lock timeout assertion

This commit is contained in:
Peter Steinberger
2026-05-09 13:36:05 +01:00
parent 1e894199db
commit e7d5e7eb2b

View File

@@ -42,13 +42,10 @@ describe("OAuth refresh lock timeout classification", () => {
const error = buildRefreshContentionError({ provider, profileId, cause });
expect(error).toMatchObject({
code: "refresh_contention",
cause: {
code: FILE_LOCK_TIMEOUT_ERROR_CODE,
lockPath: `${refreshLockPath}.lock`,
},
});
expect(error.code).toBe("refresh_contention");
expect(error.cause).toBe(cause);
expect(cause.code).toBe(FILE_LOCK_TIMEOUT_ERROR_CODE);
expect(cause.lockPath).toBe(`${refreshLockPath}.lock`);
expect(error.message).toContain("another process is already refreshing");
expect(error.message).toContain("Please wait for the in-flight refresh to finish and retry.");
});