Skip to content

Commit

Permalink
fixup! Update packages/dashboard-backend/src/devworkspaceClient/servi…
Browse files Browse the repository at this point in the history
…ces/gitConfigApi/__tests__/index.spec.ts
  • Loading branch information
akurinnoy committed Sep 26, 2024
1 parent 5c946dc commit 1af744a
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,20 +275,20 @@ email="user-2@che"
resourceVersion: '1',
} as api.IGitConfig;

let isPatched = false;
let errorMessage = '';
let isPatched = false;
let errorMessage = '';

try {
await gitConfigApiService.patch(namespace, newGitConfig);
isPatched = true;
} catch (e: unknown) {
errorMessage = (e as Error).message;
}

expect(isPatched).toBe(false);
expect(errorMessage).toBe(
'Conflict detected. The gitconfig was modified in the namespace "user-che".',
);
try {
await gitConfigApiService.patch(namespace, newGitConfig);
isPatched = true;
} catch (e: unknown) {
errorMessage = (e as Error).message;
}

expect(isPatched).toBe(false);
expect(errorMessage).toBe(
'Conflict detected. The gitconfig was modified in the namespace "user-che".',
);

expect(spyReadNamespacedConfigMap).toHaveBeenCalledTimes(1);
expect(spyPatchNamespacedConfigMap).toHaveBeenCalledTimes(0);
Expand Down

0 comments on commit 1af744a

Please sign in to comment.