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

Integrate manufacturer into catalogue items v2 #108 #144

Merged
Merged
Show file tree
Hide file tree
Changes from 73 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
80e8463
landing page logic #129
MatteoGuarnaccia5 Nov 13, 2023
b973c70
changed layout of landing page #129
MatteoGuarnaccia5 Nov 15, 2023
5a877d6
added no results found #129
MatteoGuarnaccia5 Nov 15, 2023
1086fa1
added logic for edit button so it opens dialog #129
MatteoGuarnaccia5 Nov 15, 2023
a7b49b5
unit tests #129
MatteoGuarnaccia5 Nov 15, 2023
9934efb
e2e tests #129
MatteoGuarnaccia5 Nov 15, 2023
a4094fe
removed toggle address and fixed tests accordingly #129
MatteoGuarnaccia5 Nov 16, 2023
0923b88
fixed failing e2e test
MatteoGuarnaccia5 Nov 16, 2023
631ae6c
refactored address fields
MatteoGuarnaccia5 Nov 20, 2023
778557c
Merge branch 'develop' into manufacturer-landing-page-#129
MatteoGuarnaccia5 Nov 20, 2023
e0763d8
fixed e2e tests #129
MatteoGuarnaccia5 Nov 20, 2023
95dd40c
add manufacturer logic #108
MatteoGuarnaccia5 Nov 22, 2023
ede17a3
changed catalogue item mock data #108
MatteoGuarnaccia5 Nov 22, 2023
0214487
added error messages #108
MatteoGuarnaccia5 Nov 22, 2023
8bf07a0
manufacturers render in catalogue item table
MatteoGuarnaccia5 Nov 22, 2023
8ed0d8c
refactored manufacturer in catalogue item landing page
MatteoGuarnaccia5 Nov 22, 2023
2720cc1
refactored details panel #108
MatteoGuarnaccia5 Nov 22, 2023
e7ea202
implemented logic to allow
MatteoGuarnaccia5 Nov 23, 2023
899f856
implemented logic to alllow autocomplete to prerender manufacturer fo…
MatteoGuarnaccia5 Nov 23, 2023
a4a92ff
Merge branch 'manufacturer-landing-page-#129' into integrate-manufact…
MatteoGuarnaccia5 Nov 23, 2023
803ad44
implemented manufacturer landing page into catalogue item table #108
MatteoGuarnaccia5 Nov 23, 2023
a9ec8e8
fixed linting
MatteoGuarnaccia5 Nov 23, 2023
fc7b7f0
fixed unit tests #108
MatteoGuarnaccia5 Nov 27, 2023
193636f
fixed e2e tests #108
MatteoGuarnaccia5 Nov 27, 2023
c012775
added unit tests #108
MatteoGuarnaccia5 Nov 27, 2023
6ae4292
fixed timeout issues #108
MatteoGuarnaccia5 Nov 28, 2023
a0b5f2f
added e2e tests #108
MatteoGuarnaccia5 Nov 28, 2023
3616b58
removed comment
MatteoGuarnaccia5 Nov 28, 2023
8289d1b
changed sizing/ styling
MatteoGuarnaccia5 Nov 28, 2023
9138fef
added other manufacturer coloumns #108
MatteoGuarnaccia5 Nov 28, 2023
08684d3
added filtering to columns #108
MatteoGuarnaccia5 Nov 28, 2023
c237138
fixedd unit and added url test #108
MatteoGuarnaccia5 Nov 28, 2023
469e1e2
fixed e2e tests and added url test #108
MatteoGuarnaccia5 Nov 28, 2023
15d8a97
Merge branch 'develop' into integrate-manufacturer-into-catalogue-ite…
MatteoGuarnaccia5 Nov 28, 2023
0416ee5
fixed bugs in landing page #129
MatteoGuarnaccia5 Nov 29, 2023
f026ad9
removed unnecessary console.log
MatteoGuarnaccia5 Nov 29, 2023
1813f3c
addressed changes #108
MatteoGuarnaccia5 Nov 30, 2023
f5ab019
fixed linting
MatteoGuarnaccia5 Nov 30, 2023
4f037c3
requested manufacturer landing page changes
MatteoGuarnaccia5 Dec 4, 2023
c8c8fd7
error messages requested changes
MatteoGuarnaccia5 Dec 4, 2023
e840a6a
requested changes for details panel
MatteoGuarnaccia5 Dec 4, 2023
7f29206
abstracted dialog tests and added manufacturer link test
MatteoGuarnaccia5 Dec 4, 2023
436fd1a
removed unneccasry dependency and attribute of autocomplete
MatteoGuarnaccia5 Dec 4, 2023
0d8a7a2
got rid of listItems in landing page
MatteoGuarnaccia5 Dec 4, 2023
bab3e75
creation of set in catalogue items table suggested change
MatteoGuarnaccia5 Dec 4, 2023
dc152cc
added test for catalogue item table to improve coverage for manufacturer
MatteoGuarnaccia5 Dec 4, 2023
94f28f5
fixed linting
MatteoGuarnaccia5 Dec 4, 2023
f99728e
updated snapshot
MatteoGuarnaccia5 Dec 4, 2023
3a97efa
fixed e2e test
MatteoGuarnaccia5 Dec 4, 2023
62c1dff
removed comment
MatteoGuarnaccia5 Dec 11, 2023
dfeb90a
changes in manufacturer dialog
MatteoGuarnaccia5 Dec 11, 2023
0a07549
removed cursor pointer
MatteoGuarnaccia5 Dec 11, 2023
4795755
removed add button disabled
MatteoGuarnaccia5 Dec 11, 2023
086c9b7
modified list items in details panel
MatteoGuarnaccia5 Dec 11, 2023
a8d6db5
more abstraction of tests
MatteoGuarnaccia5 Dec 11, 2023
763855d
changed layout in detail panel (manufacturer)
MatteoGuarnaccia5 Dec 11, 2023
4276b02
simplified autocomplete logic
MatteoGuarnaccia5 Dec 11, 2023
442ead3
changed rest of list items in manufacturer landing page
MatteoGuarnaccia5 Dec 11, 2023
ad6d8dc
fixed linting
MatteoGuarnaccia5 Dec 11, 2023
09905dd
Merge branch 'develop' into integrate-manufacturer-into-catalogue-ite…
MatteoGuarnaccia5 Dec 12, 2023
7559a7c
went back on autocomplete changes
MatteoGuarnaccia5 Dec 12, 2023
cb68706
removed console.logs and updated snapshot
MatteoGuarnaccia5 Dec 12, 2023
6a6de2b
updated snapshot
MatteoGuarnaccia5 Dec 12, 2023
0aa8e8c
removed increased timeout
MatteoGuarnaccia5 Dec 12, 2023
dcaa938
added timeouts
MatteoGuarnaccia5 Dec 12, 2023
26472a4
fixed formatting of landing pages
MatteoGuarnaccia5 Dec 12, 2023
71de9a9
added another timeout
MatteoGuarnaccia5 Dec 12, 2023
683fd67
implemented selectedCatalogueItemManufacturer suggestion
MatteoGuarnaccia5 Dec 12, 2023
b460838
fixed landing pages and updated snapshot
MatteoGuarnaccia5 Dec 12, 2023
15cee8d
fixed linting
MatteoGuarnaccia5 Dec 12, 2023
afd3a91
updated snapshot
MatteoGuarnaccia5 Dec 12, 2023
f80eeeb
fixed formatting for landing pages
MatteoGuarnaccia5 Dec 13, 2023
2e4c5b6
fixed test
MatteoGuarnaccia5 Dec 13, 2023
c5a14ff
fixed manufacturer tab of details panel
MatteoGuarnaccia5 Dec 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 67 additions & 32 deletions cypress/e2e/catalogue/catalogueItems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Catalogue Items', () => {
cy.findByLabelText('Drawing number').type('MX43242');
cy.findByLabelText('Drawing link').type('https://example.com');
cy.findByLabelText('Model number').type('MXtest');

cy.findByLabelText('Manufacturer *').click().type('Man{downArrow}{enter}');
cy.findByLabelText('Resolution (megapixels) *').type('18');
cy.findByLabelText('Frame Rate (fps)').type('60');
cy.findByLabelText('Sensor Type *').type('IO');
Expand All @@ -27,10 +27,6 @@ describe('Catalogue Items', () => {
cy.findByLabelText('Older than five years').click();
cy.findByText('False').click();

cy.findByLabelText('Manufacturer Name *').type('test');
cy.findByLabelText('Manufacturer URL *').type('https://test.co.uk');
cy.findByLabelText('Manufacturer Address *').type('1 house test TX3 6TY');

cy.startSnoopingBrowserMockedRequest();

cy.findByRole('button', { name: 'Save' }).click();
Expand All @@ -42,7 +38,7 @@ describe('Catalogue Items', () => {
expect(patchRequests.length).equal(1);
const request = patchRequests[0];
expect(JSON.stringify(request.body)).equal(
'{"catalogue_category_id":"4","name":"test","cost_gbp":5000,"cost_to_rework_gbp":400,"days_to_replace":14,"days_to_rework":5,"description":"test Description","item_model_number":"MXtest","is_obsolete":false,"obsolete_reason":null,"obsolete_replacement_catalogue_item_id":null,"drawing_link":"https://example.com","drawing_number":"MX43242","properties":[{"name":"Resolution","value":18},{"name":"Frame Rate","value":60},{"name":"Sensor Type","value":"IO"},{"name":"Sensor brand","value":"pixel"},{"name":"Broken","value":true},{"name":"Older than five years","value":false}],"manufacturer":{"name":"test","address":"1 house test TX3 6TY","url":"https://test.co.uk"}}'
'{"catalogue_category_id":"4","name":"test","cost_gbp":5000,"cost_to_rework_gbp":400,"days_to_replace":14,"days_to_rework":5,"description":"test Description","item_model_number":"MXtest","is_obsolete":false,"obsolete_reason":null,"obsolete_replacement_catalogue_item_id":null,"drawing_link":"https://example.com","drawing_number":"MX43242","manufacturer_id":"1","properties":[{"name":"Resolution","value":18},{"name":"Frame Rate","value":60},{"name":"Sensor Type","value":"IO"},{"name":"Sensor brand","value":"pixel"},{"name":"Broken","value":true},{"name":"Older than five years","value":false}]}'
);
});
});
Expand All @@ -64,7 +60,7 @@ describe('Catalogue Items', () => {
expect(patchRequests.length).equal(1);
const request = patchRequests[0];
expect(JSON.stringify(request.body)).equal(
'{"catalogue_category_id":"5","name":"Energy Meters 27_copy1","cost_gbp":600,"cost_to_rework_gbp":89,"days_to_replace":7,"days_to_rework":60,"description":"Precision energy meters for accurate measurements. 27","item_model_number":null,"is_obsolete":false,"obsolete_reason":null,"obsolete_replacement_catalogue_item_id":null,"drawing_link":null,"drawing_number":null,"properties":[{"name":"Measurement Range","value":2000}],"manufacturer":{"name":"Manufacturer A","url":"http://example.com","address":"10 My Street"}}'
'{"catalogue_category_id":"5","name":"Energy Meters 27_copy1","cost_gbp":600,"cost_to_rework_gbp":89,"days_to_replace":7,"days_to_rework":60,"description":"Precision energy meters for accurate measurements. 27","item_model_number":null,"is_obsolete":false,"obsolete_reason":null,"obsolete_replacement_catalogue_item_id":null,"drawing_link":null,"drawing_number":null,"manufacturer_id":"3","properties":[{"name":"Measurement Range","value":2000}]}'
);
});
});
Expand All @@ -81,9 +77,7 @@ describe('Catalogue Items', () => {
cy.findByLabelText('Cost (£) *').type('5000');
cy.findByLabelText('Time to replace (days) *').type('14');

cy.findByLabelText('Manufacturer Name *').type('test');
cy.findByLabelText('Manufacturer URL *').type('https://test.co.uk');
cy.findByLabelText('Manufacturer Address *').type('1 house test TX3 6TY');
cy.findByLabelText('Manufacturer *').click().type('Man{downArrow}{enter}');

cy.startSnoopingBrowserMockedRequest();

Expand All @@ -96,7 +90,7 @@ describe('Catalogue Items', () => {
expect(patchRequests.length).equal(1);
const request = patchRequests[0];
expect(JSON.stringify(request.body)).equal(
'{"catalogue_category_id":"4","name":"test","cost_gbp":5000,"cost_to_rework_gbp":null,"days_to_replace":14,"days_to_rework":null,"description":null,"item_model_number":null,"is_obsolete":false,"obsolete_reason":null,"obsolete_replacement_catalogue_item_id":null,"drawing_link":null,"drawing_number":null,"properties":[{"name":"Resolution","value":18},{"name":"Sensor Type","value":"IO"},{"name":"Broken","value":true}],"manufacturer":{"name":"test","address":"1 house test TX3 6TY","url":"https://test.co.uk"}}'
'{"catalogue_category_id":"4","name":"test","cost_gbp":5000,"cost_to_rework_gbp":null,"days_to_replace":14,"days_to_rework":null,"description":null,"item_model_number":null,"is_obsolete":false,"obsolete_reason":null,"obsolete_replacement_catalogue_item_id":null,"drawing_link":null,"drawing_number":null,"manufacturer_id":"1","properties":[{"name":"Resolution","value":18},{"name":"Sensor Type","value":"IO"},{"name":"Broken","value":true}]}'
);
});
});
Expand All @@ -111,6 +105,9 @@ describe('Catalogue Items', () => {
cy.findByText('Please enter how many days it would take to replace').should(
'exist'
);
cy.findByText(
'Please choose a manufacturer, or add a new manufacturer'
).should('exist');
cy.findByText('Please select either True or False').should('exist');

cy.findByLabelText('Name *').type('test');
Expand All @@ -120,6 +117,7 @@ describe('Catalogue Items', () => {
cy.findByText('True').click();
cy.findByLabelText('Cost (£) *').type('5000');
cy.findByLabelText('Time to replace (days) *').type('14');
cy.findByLabelText('Manufacturer *').click().type('Man{downArrow}{enter}');

cy.findAllByText('This field is mandatory').should('have.length', 0);
cy.findByText('Please enter name').should('not.exist');
Expand All @@ -128,6 +126,9 @@ describe('Catalogue Items', () => {
cy.findByText('Please enter how many days it would take to replace').should(
'not.exist'
);
cy.findByText(
'Please chose a manufacturer, or add a new manufacturer'
).should('not.exist');

// value error from number field

Expand All @@ -154,41 +155,38 @@ describe('Catalogue Items', () => {
cy.findByLabelText('Time to replace (days) *').type('14');

cy.findAllByText('Please enter a valid number').should('have.length', 0);

cy.findByText('Please enter a Manufacturer Name').should('exist');
cy.findByText('Please enter a Manufacturer URL').should('exist');
cy.findByText('Please enter a Manufacturer Address').should('exist');

cy.findByLabelText('Manufacturer Name *').type('test');
cy.findByLabelText('Manufacturer URL *').type('test.co.uk');
cy.findByLabelText('Drawing link').type('test.co.uk');
cy.findByLabelText('Manufacturer Address *').type('1 house test TX3 6TY');

cy.findByText('Please enter a Manufacturer Name').should('not.exist');
cy.findByText('Please enter a Manufacturer URL').should('not.exist');
cy.findByText('Please enter a Manufacturer Address').should('not.exist');

cy.findByRole('button', { name: 'Save' }).click();

cy.findAllByText(
'Please enter a valid Manufacturer URL. Only "http://" and "https://" links with typical top-level domain are accepted'
).should('exist');
cy.findAllByText(
'Please enter a valid Drawing link. Only "http://" and "https://" links with typical top-level domain are accepted'
).should('exist');
cy.findByLabelText('Manufacturer URL *').clear();

cy.findByLabelText('Drawing link').clear();
cy.findByLabelText('Manufacturer URL *').type('https://test.co.uk');

cy.findByLabelText('Drawing link').type('https://test.co.uk');
cy.findByRole('button', { name: 'Save' }).click();
cy.findByText(
'Please enter a valid Manufacturer URL. Only "http://" and "https://" links with typical top-level domain are accepted'
).should('not.exist');

cy.findAllByText(
'Please enter a valid Drawing link. Only "http://" and "https://" links with typical top-level domain are accepted'
).should('not.exist');
});

it('opens add manufacturer dialog and closes it back to catalogue item dialog', () => {
cy.findByRole('button', { name: 'Add Catalogue Item' }).click();

cy.findByRole('button', { name: 'add manufacturer' }).click();

cy.findByText('Add Manufacturer').should('exist');

cy.findByRole('button', { name: 'Cancel' }).click();

cy.findByText('Add Manufacturer').should('not.exist');

cy.findByText('Details').should('exist');
});

it('displays the table view correctly', () => {
cy.findByText('Cameras 1').should('exist');
cy.findByText('Cameras 2').should('exist');
Expand Down Expand Up @@ -243,9 +241,43 @@ describe('Catalogue Items', () => {
cy.findByLabelText('Resolution (megapixels) *').should('have.value', '12');
cy.findByLabelText('Frame Rate (fps)').should('have.value', '30');
cy.findByLabelText('Sensor Type *').should('have.value', 'CMOS');
cy.findByLabelText('Manufacturer *').should('have.value', 'Manufacturer A');

cy.findByRole('button', { name: 'Cancel' }).click();
});

it('navigates to manufacturer landing page', () => {
cy.visit('/catalogue/5');

cy.findByRole('button', { name: 'Show/Hide columns' }).click();
cy.findByRole('button', { name: 'Hide all' }).click();
cy.findByRole('checkbox', {
name: 'Toggle visibility Manufacturer Name',
}).click();
cy.get('body').click();

cy.findByRole('link', { name: 'Manufacturer A' }).click();
cy.url().should('contain', '/manufacturer/1');
});

it('checks the href property of the manufacturer link', () => {
cy.findByRole('button', { name: 'Show/Hide columns' }).click();
cy.findByText('Hide all').click();

cy.findByText('Manufacturer URL').click();

// Find the link element
cy.findAllByText('http://example.com')
.first()
.should('have.attr', 'href')
.should('include', 'http://example.com'); // Check href attribute value

cy.findAllByText('http://example.com')
.first()
.should('have.attr', 'target')
.should('include', '_blank'); // Check target attribute value
});

it('displays the expired landing page message and navigates back to the catalogue home', () => {
cy.visit('/catalogue/items/1fds');

Expand Down Expand Up @@ -336,6 +368,9 @@ describe('Catalogue Items', () => {
cy.findByLabelText('Drawing number').type('MX43242');
cy.findByLabelText('Drawing link').type('https://example.com');
cy.findByLabelText('Model number').type('MXtest');
cy.findByLabelText('Manufacturer *')
.click()
.type('Man{downArrow}{downArrow}{enter}');
cy.startSnoopingBrowserMockedRequest();

cy.findByRole('button', { name: 'Save' }).click();
Expand All @@ -347,7 +382,7 @@ describe('Catalogue Items', () => {
expect(patchRequests.length).equal(1);
const request = patchRequests[0];
expect(JSON.stringify(request.body)).equal(
'{"name":"test","description":null,"cost_gbp":6000,"cost_to_rework_gbp":894,"days_to_replace":71,"days_to_rework":605,"drawing_number":"MX43242","drawing_link":"https://example.com","item_model_number":"MXtest"}'
'{"name":"test","description":null,"cost_gbp":6000,"cost_to_rework_gbp":894,"days_to_replace":71,"days_to_rework":605,"drawing_number":"MX43242","drawing_link":"https://example.com","item_model_number":"MXtest","manufacturer_id":"2"}'
);
});
});
Expand Down
45 changes: 45 additions & 0 deletions cypress/e2e/manufacturer/manufacturer.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,51 @@ describe('Manufacturer', () => {
cy.contains('Please enter a post code or zip code.');
});
});

it('navigates to landing page and navigates back to the table view', () => {
cy.findByText('Manufacturer A').click();
cy.findByText('Telephone number:').should('exist');

cy.findByRole('link', { name: 'Manufacturer table view' }).click();

cy.findByText('Manufacturer A').should('exist');
cy.findByText('Manufacturer B').should('exist');
cy.findByText('Manufacturer C').should('exist');
});

it('navigates to landing page, opens edit dialog and closes it', () => {
cy.findByText('Manufacturer A').click();
cy.findByText('Telephone number:').should('exist');

cy.findByRole('button', { name: 'Edit' }).click();
cy.findByLabelText('Name *').should('have.value', 'Manufacturer A');
cy.findByLabelText('URL').should('have.value', 'http://example.com');
cy.findByLabelText('Address Line *').should(
'have.value',
'1 Example Street'
);
cy.findByLabelText('Town').should('have.value', 'Oxford');
cy.findByLabelText('County').should('have.value', 'Oxfordshire');
cy.findByLabelText('Country *').should('have.value', 'United Kingdom');
cy.findByLabelText('Post/Zip code *').should('have.value', 'OX1 2AB');
cy.findByLabelText('Telephone number').should('have.value', '07334893348');

cy.findByRole('button', { name: 'Cancel' }).click();
});

it('displays expired landing page message and navigates back to manufacturer table view', () => {
cy.visit('/manufacturer/invalid');

cy.findByText(
`This manufacturer doesn't exist. Please click the Home button to navigate to the manufacturer table`
).should('exist');

cy.findByRole('link', { name: 'Home' }).click();

cy.findByText('Manufacturer A').should('exist');
cy.findByText('Manufacturer B').should('exist');
cy.findByText('Manufacturer C').should('exist');
});
it('sets the table filters and clears the table filters', () => {
cy.findByText('Manufacturer A').should('exist');
cy.findByRole('button', { name: 'Clear Filters' }).should('be.disabled');
Expand Down
6 changes: 1 addition & 5 deletions src/api/catalogueItem.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,7 @@ describe('catalogue items api functions', () => {
drawing_number: null,
id: '1',
is_obsolete: false,
manufacturer: {
address: '10 My Street',
name: 'Manufacturer A',
url: 'http://example.com',
},
manufacturer_id: '1',
item_model_number: null,
name: 'Cameras 1',
obsolete_reason: null,
Expand Down
17 changes: 16 additions & 1 deletion src/api/manufacturer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import axios, { AxiosError } from 'axios';
import {
useMutation,
UseMutationResult,
useQueries,
useQuery,
useQueryClient,
UseQueryResult,
Expand Down Expand Up @@ -133,6 +134,17 @@ export const useManufacturer = (
);
};

export const useManufacturerIds = (
ids: string[]
): UseQueryResult<Manufacturer, unknown>[] => {
return useQueries({
queries: ids.map((id) => ({
queryKey: ['Manufacturer', id],
queryFn: () => fetchManufacturer(id),
})),
});
};

const editManufacturer = async (
manufacturer: EditManufacturer
): Promise<Manufacturer> => {
Expand Down Expand Up @@ -163,8 +175,11 @@ export const useEditManufacturer = (): UseMutationResult<
onError: (error) => {
console.log('Got error ' + error.message);
},
onSuccess: () => {
onSuccess: (manufacturerReturned) => {
queryClient.invalidateQueries({ queryKey: ['Manufacturers'] });
queryClient.invalidateQueries({
queryKey: ['Manufacturer', manufacturerReturned.id],
});
},
}
);
Expand Down
10 changes: 2 additions & 8 deletions src/app.types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export interface CatalogueItemDetails extends ObsoleteDetails {
drawing_number: string | null;
drawing_link: string | null;
item_model_number: string | null;
manufacturer_id: string;
}
// need so we can cast string to number e.g for 10.50
export type CatalogueItemDetailsPlaceholder = {
Expand All @@ -104,12 +105,7 @@ export interface CatalogueDetailsErrorMessages {
drawing_number: string;
drawing_link: string;
item_model_number: string;
}

export interface CatalogueItemManufacturer {
name: string;
address: string;
url: string;
manufacturer_id: string;
MatteoGuarnaccia5 marked this conversation as resolved.
Show resolved Hide resolved
}

export interface CatalogueItemProperty {
Expand All @@ -125,12 +121,10 @@ export interface CatalogueItemPropertyResponse {

export interface CatalogueItem extends CatalogueItemDetails {
properties: CatalogueItemPropertyResponse[];
manufacturer: CatalogueItemManufacturer;
id: string;
}
export interface AddCatalogueItem extends CatalogueItemDetails {
properties: CatalogueItemProperty[];
manufacturer: CatalogueItemManufacturer;
}

export interface EditCatalogueItem extends Partial<AddCatalogueItem> {
Expand Down
2 changes: 1 addition & 1 deletion src/catalogue/catalogue.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ describe('Catalogue', () => {
await waitFor(() => {
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
});
});
}, 10000);

it('opens move catalogue category dialog and can closes the dialog', async () => {
createView('/catalogue/1');
Expand Down
Loading