"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("@testing-library/react");
require("@testing-library/jest-dom");
const FileDetails_1 = __importDefault(require("./FileDetails"));
describe('FileDetails', () => {
    it('should render file details', () => {
        const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.txt" }));
        expect(container).toMatchSnapshot();
    });
    it('should render file details correctly if an extension we support is passed in', () => {
        (0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.txt", languageTestId: "language" }));
        expect(react_1.screen.getByText('test')).toBeTruthy();
        expect(react_1.screen.queryByText('test.txt')).toBeFalsy();
        expect(react_1.screen.getByText('TEXT')).toBeTruthy();
        expect(react_1.screen.getByTestId('language')).toBeTruthy();
    });
    it('should skip language if we do not support an extension', () => {
        (0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.joke", languageTestId: "language" }));
        expect(react_1.screen.getByText('test')).toBeTruthy();
        expect(react_1.screen.queryByTestId('language')).toBeFalsy();
    });
    it('should support image formats by rendering extension differently', () => {
        (0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.svg", languageTestId: "language" }));
        expect(react_1.screen.getByText('test')).toBeTruthy();
        expect(react_1.screen.queryByText('test.svg')).toBeFalsy();
        expect(react_1.screen.queryByTestId('language')).toBeFalsy();
    });
    it('should handle truncation differently', () => {
        (0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.svg", languageTestId: "language", hasTruncation: false }));
        expect(react_1.screen.getByText('test.svg')).toBeTruthy();
        expect(react_1.screen.queryByTestId('language')).toBeFalsy();
    });
    it('should include file size if prop passed in', () => {
        (0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.joke", languageTestId: "language", fileSize: "100MB" }));
        expect(react_1.screen.getByText('100MB')).toBeTruthy();
    });
});
