"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 CardinalityMessage_1 = require("./CardinalityMessage");
describe('CardinalityMessage', function () {
    it('should show the message with min and max values', function () {
        var cardinality = {
            minValue: 5,
            maxValue: 10
        };
        (0, react_2.render)(react_1.default.createElement(CardinalityMessage_1.CardinalityMessage, { cardinality: cardinality }));
        expect(react_2.screen.getByText('This attribute can have minimum 5 values and maximum 10 values')).toBeInTheDocument();
    });
    it('should show the message with min values', function () {
        var cardinality = {
            minValue: 5
        };
        (0, react_2.render)(react_1.default.createElement(CardinalityMessage_1.CardinalityMessage, { cardinality: cardinality }));
        expect(react_2.screen.getByText('This attribute can have minimum 5 values')).toBeInTheDocument();
    });
    it('should show the message with max values', function () {
        var cardinality = {
            maxValue: 10
        };
        (0, react_2.render)(react_1.default.createElement(CardinalityMessage_1.CardinalityMessage, { cardinality: cardinality }));
        expect(react_2.screen.getByText('This attribute can have maximum 10 values')).toBeInTheDocument();
    });
    it('should not show the message for minimum one value without maximum one', function () {
        var cardinality = {
            minValue: 1
        };
        var container = (0, react_2.render)(react_1.default.createElement(CardinalityMessage_1.CardinalityMessage, { cardinality: cardinality })).container;
        expect(container).toBeEmptyDOMElement();
    });
    it('should show the message about maximum value', function () {
        var cardinality = {
            minValue: 1,
            maxValue: 5
        };
        (0, react_2.render)(react_1.default.createElement(CardinalityMessage_1.CardinalityMessage, { cardinality: cardinality }));
        expect(react_2.screen.getByText('This attribute can have maximum 5 values')).toBeInTheDocument();
    });
    it('should not show the message without anyone value', function () {
        var cardinality = {};
        var container = (0, react_2.render)(react_1.default.createElement(CardinalityMessage_1.CardinalityMessage, { cardinality: cardinality })).container;
        expect(container).toBeEmptyDOMElement();
    });
    it('should not show the message if cardinality is null or undefined', function () {
        var cardinality = undefined;
        var container = (0, react_2.render)(react_1.default.createElement(CardinalityMessage_1.CardinalityMessage, { cardinality: cardinality })).container;
        expect(container).toBeEmptyDOMElement();
    });
});
