Try to test if title value is sent to createBallot from home (wip)

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

@ -44,6 +44,18 @@ describe('open good View component for each route', () => {
expect(wrapper.find(UnknownView)).toHaveLength(0);
});
it('should show CreateBallot view component with title for `/create-ballot/?title=test`', () => {
const wrapper = mount(<MemoryRouter initialEntries={['/create-ballot/?title=test']}>
<Routes/>
</MemoryRouter>
);
expect(wrapper.find(CreateBallot)).toHaveLength(1);
// expect(wrapper.html().find('input[name="title"]').value).toBe("test");
// 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);
});
it('should show Vote view component for `/vote`', () => {
const wrapper = mount(<MemoryRouter initialEntries={['/vote']}>
<Routes/>

Loading…
Cancel
Save