Files
SCM-Manager/scm-ui/src/repos/sources/containers/history.test.js

43 lines
810 B
JavaScript
Raw Normal View History

2018-11-26 15:56:41 +01:00
//@flow
import fetchMock from "fetch-mock";
import { getHistory } from "./history";
describe("get content type", () => {
const FILE_URL = "/repositories/scmadmin/TestRepo/history/file";
afterEach(() => {
fetchMock.reset();
fetchMock.restore();
});
it("should return history", done => {
2018-11-26 16:39:26 +01:00
fetchMock.get("/api/v2" + FILE_URL, {
page: 0,
pageTotal: 1,
_embedded: {
changesets: [
{
id: "1234"
},
{
id: "2345"
}
]
}
});
getHistory(FILE_URL).then(content => {
expect(content.changesets).toEqual([
2018-11-26 15:56:41 +01:00
{
id: "1234"
},
{
id: "2345"
}
2018-11-26 16:39:26 +01:00
]);
expect(content.pageCollection.page).toEqual(0);
2018-11-26 15:56:41 +01:00
done();
});
});
});