mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 08:52:26 +00:00
RelationInputDataManager: Passes down defaultParams
This commit is contained in:
parent
9162d90eb1
commit
dd98d592ae
@ -162,6 +162,33 @@ describe('RelationInputDataManager', () => {
|
|||||||
expect(container.querySelector('input')).toHaveAttribute('disabled');
|
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 () => {
|
test('Sets the disabled prop for non editable relations (edit entity)', async () => {
|
||||||
const { container } = setup({
|
const { container } = setup({
|
||||||
editable: false,
|
editable: false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user