show history table of content

This commit is contained in:
Maren Süwer
2018-11-26 15:56:41 +01:00
parent 2f9d0f2793
commit 89291cdf46
7 changed files with 79 additions and 42 deletions

View File

@@ -0,0 +1,39 @@
//@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 => {
let changesets: {
changesets: [
{
id: "1234"
},
{
id: "2345"
}
]
};
let history = {
_embedded: {
changesets
}
};
fetchMock.get("/api/v2" + FILE_URL, {
history
});
getHistory(FILE_URL).then(content => {
expect(content.changesets).toBe(changesets);
done();
});
});
});