kafka-ui/kafka-ui-react-app/src/redux/reducers/schemas/__test__/fixtures.ts
ValentinPrischepa 540b8eb79b
Schema registry pagination and search
* [ISSUE-1191, ISSUE-1208] Implemented search and pagination for schema registry overview page.

* [ISSUE-1191, ISSUE-1208] Implemented search and pagination for schema registry overview page.

* [ISSUE-1191, ISSUE-1208] Implemented search and pagination for schema registry overview page.

* [ISSUE-1191, ISSUE-1208] fixed Checkstyle violation issue.

* WIP: Fixes some frontend issues just to build frontend

* WIP: Fixes fronted just to build it

* WIP: Fixes frontend to build it

* WIP: Schemas tests are failing

* WIP: List tests work

* WIP: Details test work

* WIP: Updates tests

* WIP: Fixes lint errors and comments

* WIP: Changes usePagination, some tests have warns

* WIP: Refreshes with query string works correctly

* cleanup

* WIP: cleanup

* WIP: cleanup

* WIP: Removes ThemeProvider from test as render function uses ThemeProvider

* WIP: Pagination + Search works correcly

* WIP: Cleanup

* WIP: Cleanup

* WIP: Cleanup

Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
Co-authored-by: Damir Abdulganiev <dabdulganiev@provectus.com>
Co-authored-by: Damir Abdulganiev <damupka@gmail.com>
2022-01-31 13:24:39 +03:00

61 lines
1.5 KiB
TypeScript

import { SchemaType, SchemaSubject } from 'generated-sources';
import { RootState } from 'redux/interfaces';
export const schemasInitialState: RootState['schemas'] = {
totalPages: 0,
ids: [],
entities: {},
versions: {
latest: null,
ids: [],
entities: {},
},
};
export const schemaVersion1: SchemaSubject = {
subject: 'schema7_1',
version: '1',
id: 2,
schema:
'{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://example.com/myURI.schema.json","title":"TestRecord","type":"object","additionalProperties":false,"properties":{"f1":{"type":"integer"},"f2":{"type":"string"},"schema":{"type":"string"}}}',
compatibilityLevel: 'FULL',
schemaType: SchemaType.JSON,
};
export const schemaVersion2: SchemaSubject = {
subject: 'MySchemaSubject',
version: '2',
id: 28,
schema: '12',
compatibilityLevel: 'FORWARD_TRANSITIVE',
schemaType: SchemaType.JSON,
};
export { schemaVersion1 as schemaVersion };
export const schemasFulfilledState = {
totalPages: 1,
ids: [schemaVersion2.subject, schemaVersion1.subject],
entities: {
[schemaVersion2.subject]: schemaVersion2,
[schemaVersion1.subject]: schemaVersion1,
},
versions: {
latest: null,
ids: [],
entities: {},
},
};
export const versionFulfilledState = {
totalPages: 1,
ids: [],
entities: {},
versions: {
latest: schemaVersion2,
ids: [schemaVersion1.id, schemaVersion2.id],
entities: {
[schemaVersion2.id]: schemaVersion2,
[schemaVersion1.id]: schemaVersion1,
},
},
};