import React from 'react';
import { screen, render } from '@testing-library/react';
import { CardinalityMessage } from './CardinalityMessage';
describe('CardinalityMessage', function () {
    it('should show the message with min and max values', function () {
        var cardinality = {
            minValue: 5,
            maxValue: 10
        };
        render(React.createElement(CardinalityMessage, { cardinality: cardinality }));
        expect(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
        };
        render(React.createElement(CardinalityMessage, { cardinality: cardinality }));
        expect(screen.getByText('This attribute can have minimum 5 values')).toBeInTheDocument();
    });
    it('should show the message with max values', function () {
        var cardinality = {
            maxValue: 10
        };
        render(React.createElement(CardinalityMessage, { cardinality: cardinality }));
        expect(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 = render(React.createElement(CardinalityMessage, { cardinality: cardinality })).container;
        expect(container).toBeEmptyDOMElement();
    });
    it('should show the message about maximum value', function () {
        var cardinality = {
            minValue: 1,
            maxValue: 5
        };
        render(React.createElement(CardinalityMessage, { cardinality: cardinality }));
        expect(screen.getByText('This attribute can have maximum 5 values')).toBeInTheDocument();
    });
    it('should not show the message without anyone value', function () {
        var cardinality = {};
        var container = render(React.createElement(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 = render(React.createElement(CardinalityMessage, { cardinality: cardinality })).container;
        expect(container).toBeEmptyDOMElement();
    });
});
