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

30 lines
677 B
JavaScript
Raw Normal View History

2018-10-15 16:45:54 +02:00
//@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();
});
it("should return content", done => {
let headers = {
"Content-Type": "application/text",
"X-Programming-Language": "JAVA"
};
2018-10-15 16:45:54 +02:00
fetchMock.head("/api/v2" + CONTENT_URL, {
headers
2018-10-15 16:45:54 +02:00
});
getContentType(CONTENT_URL).then(content => {
2018-10-29 11:50:55 +01:00
expect(content.type).toBe("application/text");
expect(content.language).toBe("JAVA");
2018-10-15 16:45:54 +02:00
done();
});
});
});