mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
show source code
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user