Remove unnecessary test from album model test
This commit is contained in:
parent
db83ac7bc2
commit
81a41ffffb
1 changed files with 5 additions and 21 deletions
|
@ -1,14 +1,14 @@
|
||||||
import assert from "assert";
|
import assert from "assert";
|
||||||
import Album from "model/album";
|
import Album from "model/album";
|
||||||
import Api from "common/api";
|
|
||||||
import MockAdapter from "axios-mock-adapter";
|
import MockAdapter from "axios-mock-adapter";
|
||||||
|
import Api from "common/api";
|
||||||
|
|
||||||
|
|
||||||
const mock = new MockAdapter(Api);
|
const mock = new MockAdapter(Api);
|
||||||
|
|
||||||
const postLikeEntity = [
|
mock
|
||||||
{id: 5, AlbumFavorite: true},
|
.onPost().reply(200)
|
||||||
];
|
.onDelete().reply(200);
|
||||||
mock.onPost("foo").reply(201, postLikeEntity);
|
|
||||||
|
|
||||||
describe("model/album", () => {
|
describe("model/album", () => {
|
||||||
it("should get album entity name", () => {
|
it("should get album entity name", () => {
|
||||||
|
@ -96,20 +96,4 @@ describe("model/album", () => {
|
||||||
album.toggleLike();
|
album.toggleLike();
|
||||||
assert.equal(album.AlbumFavorite, true);
|
assert.equal(album.AlbumFavorite, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should toggle like", () => {
|
|
||||||
Api.post('foo', postLikeEntity).then(
|
|
||||||
(response) => {
|
|
||||||
assert.equal(201, response.status);
|
|
||||||
assert.deepEqual(postLikeEntity, response.data);
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
).catch(
|
|
||||||
(error) => {
|
|
||||||
done(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
Loading…
Reference in a new issue