{"size": 1398, "ext": "js", "max_stars_repo_path": "src/components/ebay-inline-notice/test/test.server.js", "max_stars_repo_name": "tws2000/ebayui-core", "max_stars_repo_stars_event_min_datetime": "2018-03-01T21:22:35.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-17T00:02:36.000Z", "max_issues_repo_path": "src/components/ebay-inline-notice/test/test.server.js", "max_issues_repo_name": "tws2000/ebayui-core", "max_issues_repo_issues_event_min_datetime": "2018-03-01T20:47:04.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T22:05:51.000Z", "max_forks_repo_path": "src/components/ebay-inline-notice/test/test.server.js", "max_forks_repo_name": "tws2000/ebayui-core", "max_forks_repo_forks_event_min_datetime": "2018-03-01T09:30:30.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-03T02:28:58.000Z"}
{"max_stars_count": 177, "max_issues_count": 1414, "max_forks_count": 79, "avg_line_length": 39.9428571429, "max_line_length": 83, "alphanum_fraction": 0.6516452074}
const { expect, use } = require('chai');
const { render } = require('@marko/testing-library');
const { testPassThroughAttributes } = require('../../../common/test-utils/server');
const template = require('..');
const mock = require('./mock');

use(require('chai-dom'));

describe('inline-notice', () => {
    it('renders with defaults', async () => {
        const input = mock.Inline;
        const { getByLabelText, getByText } = await render(template, input);
        const status = getByLabelText(input.a11yText).parentElement;
        expect(status).has.class('inline-notice__header');
        expect(status).has.property('tagName', 'SPAN');
        expect(status.parentElement).has.class('inline-notice--attention');
        expect(status.parentElement).not.to.have.attribute('aria-labelledby');

        const content = getByText(input.renderBody.text);
        expect(content).has.property('tagName', 'SPAN');
        expect(content).has.class('inline-notice__main');
    });

    it('renders with custom status type', async () => {
        const input = mock.Inline_Custom_Status;
        const { getByLabelText } = await render(template, input);
        const status = getByLabelText(input.a11yText).parentElement;
        expect(status.parentElement).has.class(`inline-notice--${input.status}`);
    });

    testPassThroughAttributes(template, {
        input: mock.Inline,
    });
});
