Skip to content

Commit 2535592

Browse files
committed
remove tests from unit folder
1 parent 33624bf commit 2535592

File tree

11 files changed

+116
-100
lines changed

11 files changed

+116
-100
lines changed

src/database/seeders/20200907150538-Music.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
module.exports = {
22
up: async (queryInterface, Sequelize) => {
3-
await queryInterface.bulkInsert("Musics", [{
4-
id: "2a7fe4a4-f6d3-4e99-a7ef-8098786073c2",
5-
countryId: "6003fb36-5112-463e-a1f9-c8944e72412f",
6-
category: "Hip Hop",
7-
gallery: "https://res.cloudinary.com/augustar/image/upload/v1599565560/music_cl7glf.jpg",
8-
event: "Concert",
3+
await queryInterface.bulkInsert(
4+
"Musics", [{
5+
id: "2a7fe4a4-f6d3-4e99-a7ef-8098786073c2",
6+
countryId: "6003fb36-5112-463e-a1f9-c8944e72412f",
7+
category: "Hip Hop",
8+
gallery: "https://res.cloudinary.com/augustar/image/upload/v1599565560/music_cl7glf.jpg",
9+
event: "Concert",
910

10-
createdAt: new Date(),
11-
updatedAt: new Date(),
12-
}],
13-
{});
11+
createdAt: new Date(),
12+
updatedAt: new Date(),
13+
}],
14+
{},
15+
);
1416
},
1517
down: async (queryInterface, Sequelize) => {
1618
await queryInterface.bulkDelete("Musics", null, {});

src/database/seeders/20200907151410-Food.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
module.exports = {
22
up: async (queryInterface, Sequelize) => {
3-
await queryInterface.bulkInsert("Foods", [{
4-
id: "9e92fadd-8897-4d3d-b9de-cf82e9752a1f",
5-
countryId: "6003fb36-5112-463e-a1f9-c8944e72412f",
6-
type: "Egusi soup",
7-
methodOfPreparation: `Add melon, onion, water and fresh pepper in a blender. Blend the ingredients together until
3+
await queryInterface.bulkInsert(
4+
"Foods", [{
5+
id: "9e92fadd-8897-4d3d-b9de-cf82e9752a1f",
6+
countryId: "6003fb36-5112-463e-a1f9-c8944e72412f",
7+
type: "Egusi soup",
8+
methodOfPreparation: `Add melon, onion, water and fresh pepper in a blender. Blend the ingredients together until
89
it forms a paste.
910
Add water, chicken, turkey, ponmo, yellow pepper, stock, smoked panla fish, crayfish, chopped pepper and palm oil
1011
to a pot. Allow all the ingredients to boil for 15 minutes.
@@ -13,11 +14,12 @@ module.exports = {
1314
Next add the Ugu leaves and Uziza, mix together and allow to cook for 5 minutes. You will notice that the oil will
1415
start to rise to the top, your Egusi Soup is now ready.
1516
Serve and enjoy with Eba, Semo, Pounded Yam or even Rice.`,
16-
gallery: "https://res.cloudinary.com/augustar/image/upload/v1599563547/pounded-yam_qfzcy7.jpg",
17-
createdAt: new Date(),
18-
updatedAt: new Date(),
19-
}],
20-
{});
17+
gallery: "https://res.cloudinary.com/augustar/image/upload/v1599563547/pounded-yam_qfzcy7.jpg",
18+
createdAt: new Date(),
19+
updatedAt: new Date(),
20+
}],
21+
{},
22+
);
2123
},
2224
down: async (queryInterface, Sequelize) => {
2325
await queryInterface.bulkDelete("Foods", null, {});

src/tests/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import "./index-test";
22
import "./models/user";
33
import "./models/profile";
4-
import "./unit/models/food.spec";
5-
import "./unit/models/music.spec";
6-
import "./unit/models/country.spec";
7-
import "./unit/models/culture.spec";
8-
import "./unit/models/comment.spec";
9-
import "./unit/models/newsletter.spec";
4+
import "./models/food.spec";
5+
import "./models/music.spec";
6+
import "./models/country.spec";
7+
import "./models/culture.spec";
8+
import "./models/comment.spec";
9+
import "./models/newsletter.spec";

src/tests/unit/models/Comment.spec.js renamed to src/tests/models/comment.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const {
1212
checkPropertyExists,
1313
} = require("sequelize-test-helpers");
1414

15-
const CommentModel = require("../../../models/comment.js");
15+
const CommentModel = require("../../models/comment.js");
1616

1717
describe("src/models/comment", () => {
1818
const Comment = CommentModel(sequelize, dataTypes);

src/tests/unit/models/country.spec.js renamed to src/tests/models/country.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
import chai, { expect } from "chai";
88

99
import sinonChai from "sinon-chai";
10-
import CountryModel from "../../../models/countries";
10+
import CountryModel from "../../models/countries";
1111

1212
chai.use(sinonChai);
1313

src/tests/unit/models/culture.spec.js renamed to src/tests/models/culture.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
import chai, { expect } from "chai";
88

99
import sinonChai from "sinon-chai";
10-
import CultureModel from "../../../models/culture";
10+
import CultureModel from "../../models/culture";
1111

1212
chai.use(sinonChai);
1313

src/tests/models/food.spec.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import chai, { expect } from "chai";
2+
import sinonChai from "sinon-chai";
3+
import {
4+
sequelize,
5+
dataTypes,
6+
checkModelName,
7+
checkPropertyExists,
8+
} from "sequelize-test-helpers";
9+
10+
import foodModel from "../../models/food";
11+
12+
chai.use(sinonChai);
13+
14+
describe(
15+
"src/models/food", () => {
16+
const Food = foodModel(sequelize, dataTypes);
17+
const food = new Food();
18+
19+
checkModelName(Food)("Foods");
20+
21+
context(
22+
"properties", () => {
23+
["countryId", "type", "methodOfPreparation", "gallery"].forEach(
24+
checkPropertyExists(food),
25+
);
26+
},
27+
);
28+
context(
29+
"associations", () => {
30+
const Country = "Country";
31+
32+
before(() => {
33+
Food.associate({ Country });
34+
});
35+
36+
it("defined a belongsTo association with Country", () => {
37+
expect(Food.belongsTo).to.have.been.calledWith(Country);
38+
});
39+
},
40+
);
41+
},
42+
);

src/tests/models/music.spec.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import chai, { expect } from "chai";
2+
import sinonChai from "sinon-chai";
3+
import {
4+
sequelize,
5+
dataTypes,
6+
checkModelName,
7+
checkPropertyExists,
8+
} from "sequelize-test-helpers";
9+
10+
import musicModel from "../../models/music";
11+
12+
describe(
13+
"src/models/music", () => {
14+
const Music = musicModel(sequelize, dataTypes);
15+
const music = new Music();
16+
checkModelName(Music)("Musics");
17+
18+
context(
19+
"properties", () => {
20+
["countryId", "category", "gallery", "event"].forEach(
21+
checkPropertyExists(music),
22+
);
23+
},
24+
);
25+
26+
context(
27+
"associations", () => {
28+
const Country = "Nigeria";
29+
30+
before(() => {
31+
Music.associate({ Country });
32+
});
33+
34+
it("defined a belongsTo association with Country", () => {
35+
expect(Music.belongsTo).to.have.been.calledWith(Country);
36+
});
37+
},
38+
);
39+
},
40+
);

src/tests/unit/models/Newsletter.spec.js renamed to src/tests/models/newsletter.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const {
1212
checkPropertyExists,
1313
} = require("sequelize-test-helpers");
1414

15-
const NewsletterModel = require("../../../models/newsletter.js");
15+
const NewsletterModel = require("../../models/newsletter.js");
1616

1717
describe("src/models/newsletter", () => {
1818
const Newsletter = NewsletterModel(sequelize, dataTypes);

src/tests/unit/models/food.spec.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)