Skip to content
Snippets Groups Projects
Commit 582d8c3f authored by Lucendio's avatar Lucendio
Browse files

Integrate PR #33

* remove 'renders a todo add' test since it was a) the wrong place
  and b) already implemented by PR #36
* fix indentation and make sure that there is actually a user that
  the test tries to delete
parent 3c9aa29f
No related branches found
No related tags found
No related merge requests found
......@@ -26,14 +26,6 @@ test('renders a login form', async () => {
await waitFor(() => getByText(/Login/i));
});
test('renders a todo add', async () => {
const { getByText } = render(<AddToDo />);
await waitForElement(() => getByText(/Add/i));
await waitForElement(() => getByText(/ToDo Title/i));
await waitForElement(() => getByText(/ToDo Description/i));
await waitForElement(() => getByText(/Reset/i));
});
test('renders registration form when register button clicked', async () => {
const { getByText } = render(<App />);
await waitFor(() => getByText(/Signup/i));
......
......@@ -31,19 +31,22 @@ describe( 'Model: Users', ()=>{
expect( userRecord ).toEqual( expect.objectContaining( userInfo ) );
});
test( 'deleting a user', async ()=>{
const userData = {
name: 'myname',
email: 'myname@example.com',
password: 'mypassword'
};
test( 'deleting a user', async ()=>{
const userData = {
name: 'anothername',
email: 'anothername@example.com',
password: 'anotherpassword'
};
const DelOp = await Users.remove({ email: userData.email })
const userDoc = await Users( userData );
await userDoc.save();
const userRecord = await Users.findOne({ email: userData.email });
await Users.remove({ email: userData.email })
expect( userRecord ).toBeNull();
});
const userRecord = await Users.findOne({ email: userData.email });
expect( userRecord ).toBeNull();
});
afterAll( async ()=>{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment