enzymejs/enzyme

click to simulate an active div tag

開放

#1,426 建立於 2017年12月11日

 (12 則留言) (0 個反應) (0 位負責人)JavaScript (1,967 個分叉)batch import
docshelp wantedv3 expected difference

倉庫指標

星標
 (19,826 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Hi guys, I'm here with another issue. Its reactjs. my tags are similar to following:- <div class="conversationItem"><span>piloy</span>.....</div> Onclick, the div will change to following:- <div class="conversationItem active"><span>piloy</span>.....</div>

This is the test i wrote to simulate the click activity:-

            wrapper.find('div.conversationItem').simulate('click');
            wrapper.update();
            expect(wrapper.find('div.conversationItem.active')).to.have.length(1);

But its not working as i expected. div.conversationItem.active is never found. it's count is 0. People, Please help me to overcome this.

貢獻者指南