add mockup for content classes

This commit is contained in:
Maren Süwer
2018-10-15 16:45:54 +02:00
parent af81f239e1
commit c23fa319a0
6 changed files with 181 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
//@flow
import fetchMock from "fetch-mock";
import { getContentType } from "./Content";
describe("get content type", () => {
const CONTENT_URL = "/repositories/scmadmin/TestRepo/content/testContent";
afterEach(() => {
fetchMock.reset();
fetchMock.restore();
});
xit("should return content", done => {
fetchMock.head("/api/v2" + CONTENT_URL, {
"Content-Type": "text/plain"
});
getContentType(CONTENT_URL).then(content => {
expect(content).toBe("This is a testContent");
done();
});
});
});