Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

reactjs - How to write test cases for tabs in material-ui using react testing library

I am using Material UI tabs in my application and using react testing library. I need to write test cases which should be in a way that I need to move from one tab to another tab. I am providing the code below. Can anybody help me with this? Thanks in advance.

Code:

const [value, setValue] = React.useState(0)
    
    function handleChange(event, newValue)
    {
    setValue(newValue)
    }

    <AntTabs value={value} onChange={handleChange} aria-label="Unit information"  >
          <AntTab label=" HELLOW1" {...Unittabprops(0)} />
          <AntTab label="HELLOW2" {...Unittabprops(1)} />
         <AntTab label="HELLOW3"  {...Unittabprops(2)}/>
        <AntTab label="HELLOW4" {...Unittabprops(3)} />
        <AntTab label="HELLOW5" {...Unittabprops(4)} />
    </AntTabs>
question from:https://stackoverflow.com/questions/65923471/how-to-write-test-cases-for-tabs-in-material-ui-using-react-testing-library

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...