Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/bai 796 get api v2 schemas #664

Merged
merged 14 commits into from
Aug 7, 2023
Merged

Conversation

JR40159
Copy link
Member

@JR40159 JR40159 commented Aug 3, 2023

No description provided.

@JR40159 JR40159 marked this pull request as ready for review August 3, 2023 11:12
id: 'example-schema-2',
name: 'Example Schema 2',
description: '',
const schemas: Array<SchemaInterface> = await findSchemasByKind(query.kind)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary typing. If TypeScript can't work it out for itself, you should add a return type to findSchemasByKind instead of putting it here.

@@ -0,0 +1,45 @@
import { SchemaKind } from '../../src/models/v2/Schema.js'

export const testModelSchema = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should probably be 'testSchemas' instead of 'testModels'.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a misunderstanding of the meaning of 'models' in this context. I'm intending this file to be the V2 version of https://github.com/gchq/Bailo/blob/main/backend/src/utils/test/testModels.ts

}
})
vi.mock('../../src/models/v2/Schema.js', () => ({
SchemaKind: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should import this (via e.g. importActual), instead of mocking it. Alternatively, we could put it in a separate types folder.

@JR40159 JR40159 merged commit 4daa676 into main Aug 7, 2023
@JR40159 JR40159 deleted the feature/BAI-796-get-api-v2-schemas branch August 7, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants