Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/devin/main/904790/1' into devin/…
Browse files Browse the repository at this point in the history
…main/904790/merge
  • Loading branch information
devin-ai-integration[bot] committed Jul 13, 2024
2 parents 9808a15 + 31c028d commit 5ed90a4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Third party dependencies.
import React from 'react';
import { shallow } from 'enzyme';
import { render, screen } from '@testing-library/react-native';

// External dependencies.
import Tag from '../../../../Tags/Tag';
Expand All @@ -11,26 +11,24 @@ import { BADGE_BASE_TEST_ID } from './BadgeBase.constants';

describe('BadgeBase - snapshots', () => {
it('should render badge correctly', () => {
const wrapper = shallow(
const { toJSON } = render(
<BadgeBase>
<Tag label={'Children'} />
</BadgeBase>,
);
expect(wrapper).toMatchSnapshot();
expect(toJSON()).toMatchSnapshot();
});
});

describe('BadgeBase', () => {
it('should render badge with the given content', () => {
const wrapper = shallow(
render(
<BadgeBase>
<Tag label={'Children'} />
</BadgeBase>,
);

const contentElement = wrapper.findWhere(
(node) => node.prop('testID') === BADGE_BASE_TEST_ID,
);
expect(contentElement.exists()).toBe(true);
const contentElement = screen.getByTestId(BADGE_BASE_TEST_ID);
expect(contentElement).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,34 @@ exports[`BadgeBase - snapshots should render badge correctly 1`] = `
style={{}}
testID="badge-base"
>
<Tag
label="Children"
/>
<View
style={
{
"backgroundColor": "#ffffff",
"borderColor": "#bbc0c5",
"borderRadius": 10,
"borderWidth": 1,
"height": 24,
"justifyContent": "center",
"paddingHorizontal": 4,
}
}
>
<Text
accessibilityRole="text"
style={
{
"color": "#141618",
"fontFamily": "Euclid Circular B",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 22,
}
}
>
Children
</Text>
</View>
</View>
`;

0 comments on commit 5ed90a4

Please sign in to comment.