用mocha測試select

Question

如何用mocha測試select

原因

尚未找到

解決方案

使用event和simulate結合     

 const event = {

        target: { value: 25 }

      };

      frame

        .find(".tes-components-Gallery-maximumSelect")

        .simulate("change", event);

      expect(

        frame.find(".tes-components-Gallery-maximumSelect").props().value

      ).equal(25);

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章