RelationInputDataManager: Passes down defaultParams

This commit is contained in:
Gustav Hansen 2022-10-17 14:46:42 +02:00
parent 9162d90eb1
commit dd98d592ae

View File

@ -162,6 +162,33 @@ describe('RelationInputDataManager', () => {
expect(container.querySelector('input')).toHaveAttribute('disabled');
});
test('Passes down defaultParams to the relation and search endpoints', async () => {
setup({
queryInfos: {
defaultParams: {
something: true,
},
shouldDisplayRelationLink: true,
},
});
expect(useRelation).toBeCalledWith(
expect.any(String),
expect.objectContaining({
search: expect.objectContaining({
pageParams: expect.objectContaining({
something: true,
}),
}),
relation: expect.objectContaining({
pageParams: expect.objectContaining({
something: true,
}),
}),
})
);
});
test('Sets the disabled prop for non editable relations (edit entity)', async () => {
const { container } = setup({
editable: false,