Skip to content

Commit

Permalink
EW-709 fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psachmann committed Mar 15, 2024
1 parent bb92ba1 commit 918e070
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions apps/server/src/modules/board/service/column.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ describe(ColumnService.name, () => {
await module.close();
});

beforeEach(() => {
jest.clearAllMocks();
});

describe('findById', () => {
describe('when finding a column', () => {
const setup = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ describe('CommonCartridgeManifestParser', () => {
const { sut } = await setup();
const result = sut.getOrganizations();

expect(result).toBe('201510-AMH-2020-70C-12218-US History Since 1877');
expect.any(String);
expect(result).toHaveLength(117);
});
});

Expand All @@ -110,7 +109,7 @@ describe('CommonCartridgeManifestParser', () => {
const { sut } = await setup();
const result = sut.getOrganizations();

expect(result).toBe([]);
expect(result).toHaveLength(0);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UUID } from 'bson';
import { randomUUID } from 'crypto';
import { CommonCartridgeFileParserOptions, OrganizationProps } from '../common-cartridge-import.types';

type SearchElement = { depth: number; path: string; element: Element };
Expand Down Expand Up @@ -74,7 +74,7 @@ export class CommonCartridgeOrganizationVisitor {
}

private getElementIdentifier(element: Element): string {
const identifier = element.getAttribute('identifier') ?? `i${UUID.generate().toString()}`;
const identifier = element.getAttribute('identifier') ?? `i${randomUUID()}`;

return identifier;
}
Expand Down

0 comments on commit 918e070

Please sign in to comment.