mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
show history table of content
This commit is contained in:
39
scm-ui/src/repos/sources/containers/history.test.js
Normal file
39
scm-ui/src/repos/sources/containers/history.test.js
Normal 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();
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user