"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 SourcesCard_1 = __importDefault(require("./SourcesCard"));
describe('SourcesCard', () => {
    it('should render sources correctly if one source is passed in', () => {
        (0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [{ title: 'How to make an apple pie', link: '' }] }));
        expect(react_1.screen.getByText('1 source')).toBeTruthy();
        expect(react_1.screen.getByText('How to make an apple pie')).toBeTruthy();
    });
    it('should render sources correctly when there is more than one', () => {
        (0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
                { title: 'How to make an apple pie', link: '' },
                { title: 'How to make cookies', link: '' }
            ] }));
        expect(react_1.screen.getByText('2 sources')).toBeTruthy();
        expect(react_1.screen.getByText('How to make an apple pie')).toBeTruthy();
        expect(react_1.screen.getByText('1/2')).toBeTruthy();
        react_1.screen.getByRole('button', { name: /Go to previous page/i });
        react_1.screen.getByRole('button', { name: /Go to next page/i });
    });
});
