test if title value is sent to createBallot from home

pull/4/head
Clement G 5 years ago committed by guhur
parent a6038e0ca9
commit 940179d358

@ -44,15 +44,13 @@ describe('open good View component for each route', () => {
expect(wrapper.find(UnknownView)).toHaveLength(0); expect(wrapper.find(UnknownView)).toHaveLength(0);
}); });
it('should show CreateBallot view component with title for `/create-ballot/?title=test`', () => { it('should show CreateBallot view component with title for `/create-ballot/?title=test%20with%20title`', () => {
const wrapper = mount(<MemoryRouter initialEntries={['/create-ballot/?title=test']}> const wrapper = mount(<MemoryRouter initialEntries={['/create-ballot/?title=test%20with%20title']}>
<Routes/> <Routes/>
</MemoryRouter> </MemoryRouter>
); );
expect(wrapper.find(CreateBallot)).toHaveLength(1); expect(wrapper.find(CreateBallot)).toHaveLength(1);
// expect(wrapper.html().find('input[name="title"]').value).toBe("test"); expect(wrapper.find('input[name="title"]').props().defaultValue).toBe("test with title");
// expect(wrapper.find('input[name="title"]')[0].value).toBe("test");
// expect(wrapper.find('input[name="title"]').value).toBe("test");
expect(wrapper.find(UnknownView)).toHaveLength(0); expect(wrapper.find(UnknownView)).toHaveLength(0);
}); });

Loading…
Cancel
Save