mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 14:05:44 +01:00
30 lines
677 B
JavaScript
30 lines
677 B
JavaScript
//@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"
|
|
};
|
|
|
|
fetchMock.head("/api/v2" + CONTENT_URL, {
|
|
headers
|
|
});
|
|
|
|
getContentType(CONTENT_URL).then(content => {
|
|
expect(content.type).toBe("application/text");
|
|
expect(content.language).toBe("JAVA");
|
|
done();
|
|
});
|
|
});
|
|
});
|