Skip to content

Commit

Permalink
feat(modal-title): fix banner
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelmar committed Dec 13, 2024
1 parent abb7ada commit aa3dafe
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 33 deletions.
40 changes: 20 additions & 20 deletions src/components/Banner/Banner.unit.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('<Banner />', () => {
it('should match snapshot', () => {
expect.assertions(1);

const container = mount(<Banner />);
const container = mount(<Banner aria-label="Some banner" />);

expect(container).toMatchSnapshot();
});
Expand All @@ -24,7 +24,7 @@ describe('<Banner />', () => {

const className = 'example-class';

const container = mount(<Banner className={className} />);
const container = mount(<Banner aria-label="Some banner" className={className} />);

expect(container).toMatchSnapshot();
});
Expand All @@ -34,7 +34,7 @@ describe('<Banner />', () => {

const id = 'example-id';

const container = mount(<Banner id={id} />);
const container = mount(<Banner aria-label="Some banner" id={id} />);

expect(container).toMatchSnapshot();
});
Expand All @@ -44,7 +44,7 @@ describe('<Banner />', () => {

const style = { color: 'pink' };

const container = mount(<Banner style={style} />);
const container = mount(<Banner aria-label="Some banner" style={style} />);

expect(container).toMatchSnapshot();
});
Expand All @@ -63,7 +63,7 @@ describe('<Banner />', () => {
</ButtonGroup>
);

const container = await mountAndWait(<Banner actions={actions} />);
const container = await mountAndWait(<Banner aria-label="Some banner" actions={actions} />);

expect(container).toMatchSnapshot();
});
Expand All @@ -73,7 +73,7 @@ describe('<Banner />', () => {

const description = 'Description';

const container = mount(<Banner description={description} />);
const container = mount(<Banner aria-label="Some banner" description={description} />);

expect(container).toMatchSnapshot();
});
Expand All @@ -83,7 +83,7 @@ describe('<Banner />', () => {

const details = 'Details';

const container = mount(<Banner details={details} />);
const container = mount(<Banner aria-label="Some banner" details={details} />);

expect(container).toMatchSnapshot();
});
Expand All @@ -93,7 +93,7 @@ describe('<Banner />', () => {

const image = <Avatar initials="CW" />;

const container = await mountAndWait(<Banner image={image} />);
const container = await mountAndWait(<Banner aria-label="Some banner" image={image} />);

expect(container).toMatchSnapshot();
});
Expand All @@ -103,7 +103,7 @@ describe('<Banner />', () => {

const isAlert = true;

const container = mount(<Banner isAlert={isAlert} />);
const container = mount(<Banner aria-label="Some banner" isAlert={isAlert} />);

expect(container).toMatchSnapshot();
});
Expand All @@ -113,7 +113,7 @@ describe('<Banner />', () => {

const shape = Object.values(CONSTANTS.SHAPES).pop();

const container = mount(<Banner shape={shape} />);
const container = mount(<Banner aria-label="Some banner" shape={shape} />);

expect(container).toMatchSnapshot();
});
Expand Down Expand Up @@ -160,7 +160,7 @@ describe('<Banner />', () => {
it('should have its wrapper class', () => {
expect.assertions(1);

const element = mount(<Banner />)
const element = mount(<Banner aria-label="Some banner" />)
.find(Banner)
.getDOMNode();

Expand All @@ -172,7 +172,7 @@ describe('<Banner />', () => {

const className = 'example-class';

const element = mount(<Banner className={className} />)
const element = mount(<Banner aria-label="Some banner" className={className} />)
.find(Banner)
.getDOMNode();

Expand All @@ -184,7 +184,7 @@ describe('<Banner />', () => {

const id = 'example-id';

const element = mount(<Banner id={id} />)
const element = mount(<Banner aria-label="Some banner" id={id} />)
.find(Banner)
.getDOMNode();

Expand All @@ -197,7 +197,7 @@ describe('<Banner />', () => {
const style = { color: 'pink' };
const styleString = 'color: pink;';

const element = mount(<Banner style={style} />)
const element = mount(<Banner aria-label="Some banner" style={style} />)
.find(Banner)
.getDOMNode();

Expand All @@ -218,7 +218,7 @@ describe('<Banner />', () => {
</ButtonGroup>
);

const container = await mountAndWait(<Banner actions={actions} />);
const container = await mountAndWait(<Banner aria-label="Some banner" actions={actions} />);

expect(container.contains(actions)).toBe(true);
});
Expand All @@ -228,7 +228,7 @@ describe('<Banner />', () => {

const description = 'Description';

const container = mount(<Banner description={description} />);
const container = mount(<Banner aria-label="Some banner" description={description} />);
const target = container.getDOMNode().getElementsByClassName(CONSTANTS.STYLE.description)[0];

expect(target.innerHTML).toBe(description);
Expand All @@ -239,7 +239,7 @@ describe('<Banner />', () => {

const details = 'Details';

const container = mount(<Banner details={details} />);
const container = mount(<Banner aria-label="Some banner" details={details} />);
const target = container.getDOMNode().getElementsByClassName(CONSTANTS.STYLE.details)[0];

expect(target.innerHTML).toBe(details);
Expand All @@ -250,7 +250,7 @@ describe('<Banner />', () => {

const image = <Avatar initials="CW" />;

const container = await mountAndWait(<Banner image={image} />);
const container = await mountAndWait(<Banner aria-label="Some banner" image={image} />);

expect(container.contains(image)).toBe(true);
});
Expand All @@ -260,7 +260,7 @@ describe('<Banner />', () => {

const isAlert = true;

const container = mount(<Banner isAlert={isAlert} />);
const container = mount(<Banner aria-label="Some banner" isAlert={isAlert} />);
const target = container.find(Banner).getDOMNode();

expect(target.getAttribute('data-alert')).toBe(`${isAlert}`);
Expand All @@ -271,7 +271,7 @@ describe('<Banner />', () => {

const shape = Object.values(CONSTANTS.SHAPES).pop();

const container = mount(<Banner shape={shape} />);
const container = mount(<Banner aria-label="Some banner" shape={shape} />);
const target = container.find(Banner).getDOMNode();

expect(target.getAttribute('data-shape')).toBe(shape);
Expand Down
Loading

0 comments on commit aa3dafe

Please sign in to comment.