Skip to content
Snippets Groups Projects
Commit 86475a68 authored by Marius's avatar Marius
Browse files

IT WORKS now about now?

parent 0fe30a53
No related branches found
No related tags found
No related merge requests found
Pipeline #25405 failed
......@@ -37,7 +37,7 @@ test('DB test create article', () => {
return databaseArticle.create(b).then(a => expect(1).toBe(1));
});
test('findOne', () => {
test('findOne Article', () => {
expect.assertions(2);
return databaseArticle.findOne({ where: { id: 1 } }).then(cat => {
expect(cat.headline).toMatch('Test sak');
......@@ -45,11 +45,30 @@ test('findOne', () => {
});
});
test('DB test findAll', async () => {
test('DB test create article', () => {
expect.assertions(1);
let c = new CategoryData('mordi');
return databaseCategory.create(c).then(a => expect(1).toBe(1));
});
test('findOne Category', () => {
expect.assertions(2);
return databaseCategory.findOne({ where: { id: 1 } }).then(cat => {
expect(cat.name).toMatch('mordi');
expect(cat.name).not.toMatch('somthing');
});
});
test('DB test findAll articles', async () => {
expect.assertions(1);
return databaseArticle.findAll().then(a => expect(a.length).toBe(2));
});
test('DB test findAll categoryes', async () => {
expect.assertions(1);
return databaseCategory.findAll().then(a => expect(a.length).toBe(2));
});
// let b = new Article(
// 'Test sak',
// 'Occaecat mollit mollit sunt adipisicing laboris sunt dolore adipisicing eiusmod minim duis duis. Veniam reprehenderit nostrud excepteur elit. Mollit cupidatat commodo veniam sunt minim mollit. Aliqua magna laboris non deserunt culpa commodo incididunt aliqua. Do tempor fugiat est ad consequat id qui laboris labore qui sunt elit. Consequat consectetur culpa id minim aute cillum aliquip excepteur aliqua.',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment