File tree Expand file tree Collapse file tree
packages/ra-core/src/controller/field Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -416,9 +416,9 @@ const AuthorList = ({ source }) => {
416416} ;
417417
418418// test queryOptions type, it should support onSuccess and onError
419- export const QueryOptions = ( ) => (
419+ export const QueryOptions = ( { dataProvider } ) => (
420420 < TestMemoryRouter initialEntries = { [ '/authors/1/show' ] } >
421- < CoreAdmin dataProvider = { dataProviderWithAuthors } >
421+ < CoreAdmin dataProvider = { dataProvider } >
422422 < Resource
423423 name = "authors"
424424 show = {
@@ -431,6 +431,7 @@ export const QueryOptions = () => (
431431 onSuccess : ( ) =>
432432 console . log ( 'Query successful' ) ,
433433 onError : ( ) => console . log ( 'Query failed' ) ,
434+ retry : false ,
434435 } }
435436 >
436437 < AuthorList source = "title" />
@@ -441,3 +442,18 @@ export const QueryOptions = () => (
441442 </ CoreAdmin >
442443 </ TestMemoryRouter >
443444) ;
445+
446+ QueryOptions . args = {
447+ dataProvider : dataProviderWithAuthors ,
448+ } ;
449+
450+ QueryOptions . argTypes = {
451+ dataProvider : {
452+ control : { type : 'radio' } ,
453+ options : [ 'No error' , 'With Error' ] ,
454+ mapping : {
455+ 'No error' : dataProviderWithAuthors ,
456+ 'With Error' : dataProviderWithAuthorsError ,
457+ } ,
458+ } ,
459+ } ;
You can’t perform that action at this time.
0 commit comments