File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 11import {
22 cleanup ,
3+ findByTestId ,
34 getByLabelText ,
45 queryAllByLabelText ,
56 render ,
@@ -68,6 +69,13 @@ describe("Preview - Rendering", () => {
6869 cleanup ( ) ;
6970 } ) ;
7071
72+ it ( "should render the empty state when no parameters are present" , async ( ) => {
73+ const page = render ( < TestApp parameters = { [ ] } /> ) ;
74+
75+ expect ( findByTestId ( page . container , "preview-empty-state" ) ) ;
76+
77+ } )
78+
7179 it ( "should render the default example as expected" , async ( ) => {
7280 const page = render ( < TestApp parameters = { defaultExampleParameters } /> ) ;
7381
@@ -86,7 +94,7 @@ describe("Preview - Rendering", () => {
8694 page . container ,
8795 "How do you want to format the options of the next parameter?Immutable" ,
8896 ) ;
89- expect ( formTypeSelects ) . length ( 4 ) ;
97+ expect ( formTypeSelects ) . toHaveLength ( 4 ) ;
9098
9199 expect ( formTypeSelects [ 0 ] . innerText ) . toBe ( "Radio Selector" ) ;
92100
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ export const Preview: FC<PreviewProps> = ({
235235
236236const PreviewEmptyState = ( ) => {
237237 return (
238- < div className = "flex flex-col items-center justify-center gap-3" >
238+ < div className = "flex flex-col items-center justify-center gap-3" data-testid = "preview-empty-state" >
239239 < div className = "flex items-center justify-center rounded-[6px] bg-highlight-sky p-2" >
240240 < ActivityIcon className = "text-content-invert" width = { 24 } height = { 24 } />
241241 </ div >
You can’t perform that action at this time.
0 commit comments