show source code

This commit is contained in:
Maren Süwer
2018-10-29 11:50:55 +01:00
parent abad7d905c
commit 370bcd1845
6 changed files with 243 additions and 15 deletions

View File

@@ -1,10 +1,9 @@
//@flow
import fetchMock from "fetch-mock";
import { getContent } from "./SourcecodeViewer";
import { getContent, getLanguage } from "./SourcecodeViewer";
describe("get content", () => {
const CONTENT_URL =
"/repositories/scmadmin/TestRepo/content/testContent";
const CONTENT_URL = "/repositories/scmadmin/TestRepo/content/testContent";
afterEach(() => {
fetchMock.reset();
@@ -20,3 +19,12 @@ describe("get content", () => {
});
});
});
describe("get correct language Type", () => {
it("should return javascript", () => {
expect(getLanguage("application/javascript")).toBe("javascript");
});
it("should return text", () => {
expect(getLanguage("text/plain")).toBe("plain");
});
});