"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var react_2 = require("@testing-library/react");
var SearchValueContext_1 = require("../contexts/SearchValueContext");
var SearchHighlighter_1 = require("./SearchHighlighter");
describe('SearchHighlighter test', function () {
    it('should render SearchHighlighter as well', function () {
        var highlightedValue = '1';
        var attributeValue = 'Attribute 1 Label';
        var container = (0, react_2.render)(react_1.default.createElement(SearchValueContext_1.SearchValueContext.Provider, { value: highlightedValue },
            react_1.default.createElement(SearchHighlighter_1.SearchHighlighter, { text: attributeValue }))).container;
        var highlightedText = react_2.screen.getByText(highlightedValue);
        expect(highlightedText).toBeInTheDocument();
        expect(highlightedText).toHaveClass('highlightedText');
        expect(container).toHaveTextContent(attributeValue);
    });
    it('should work without SearchValueContext', function () {
        (0, react_2.render)(react_1.default.createElement(SearchHighlighter_1.SearchHighlighter, { text: 'Attribute text' }));
        expect(react_2.screen.getByText('Attribute text')).toBeInTheDocument();
    });
    it('should work without highlighted value', function () {
        var attributeValue = 'Attribute 1 Label';
        var container = (0, react_2.render)(react_1.default.createElement(SearchValueContext_1.SearchValueContext.Provider, { value: undefined },
            react_1.default.createElement(SearchHighlighter_1.SearchHighlighter, { text: attributeValue }))).container;
        expect(container).toHaveTextContent(attributeValue);
        expect(container.querySelector('.highlightedText')).toBeNull();
    });
});
