Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observation.org/react-native-components",
"version": "1.64.0",
"version": "1.65.0",
"main": "src/index.ts",
"repository": "git@github.com:observation/react-native-components.git",
"author": "Observation.org",
Expand All @@ -16,7 +16,7 @@
"@rnx-kit/align-deps": "^3.3.4",
"@testing-library/react-native": "^13.3.3",
"@types/color": "^4.2.0",
"@types/jest": "^29.5.14",
"@types/jest": "^30.0.0",
"@types/react": "^19.2.0",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
Expand All @@ -27,7 +27,7 @@
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-native": "^5.0.0",
"globals": "^16.5.0",
"jest": "^29.7.0",
"jest": "^30.2.0",
"prettier": "^3.7.4",
"react": "19.2.0",
"react-native": "0.83.1",
Expand Down
6 changes: 3 additions & 3 deletions src/components/__tests__/Accordion.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('Accordion', () => {
fireEvent.press(getByText('Header 1st item'))

// THEN
expect(onOpen).toBeCalledTimes(1)
expect(onOpen).toHaveBeenCalledTimes(1)
expect(queryByText('Body 1st item')).toBeTruthy()
expect(toJSON()).toMatchSnapshot()
})
Expand All @@ -64,7 +64,7 @@ describe('Accordion', () => {
fireEvent.press(getByText('Header 2nd item'))

// THEN
expect(onOpen).toBeCalledTimes(2)
expect(onOpen).toHaveBeenCalledTimes(2)
expect(queryByText('Body 2nd item')).toBeTruthy()

expect(toJSON()).toMatchSnapshot()
Expand All @@ -81,7 +81,7 @@ describe('Accordion', () => {
fireEvent.press(getByText('Header 1st item'))

// THEN
expect(onOpen).toBeCalledTimes(1)
expect(onOpen).toHaveBeenCalledTimes(1)
expect(queryByText('Body 1st item')).not.toBeTruthy()
expect(toJSON()).toMatchSnapshot()
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/BackButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ describe('BackButton', () => {
fireEvent.press(getByTestId('pressable'))

// THEN
expect(mockNavigation.goBack).toBeCalled()
expect(mockNavigation.goBack).toHaveBeenCalled()
})
})
2 changes: 1 addition & 1 deletion src/components/__tests__/BottomSheet.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('BottomSheet', () => {
fireEvent.press(getByText('Action!'))

// THEN
expect(onPress).toBeCalled()
expect(onPress).toHaveBeenCalled()
})
})
})
2 changes: 1 addition & 1 deletion src/components/__tests__/Disclose.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ describe('Disclose', () => {
fireEvent.press(getByText(/some text/))

// THEN
expect(onPress).toBeCalled()
expect(onPress).toHaveBeenCalled()
})
})
2 changes: 1 addition & 1 deletion src/components/__tests__/DocumentLinks.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ describe('DocumentLink', () => {
<DocumentLink onPress={onPress} containerStyle={{ flex: 1 }} label="Privacy statement" />,
)
await fireEvent.press(getByText('Privacy statement'))
expect(onPress).toBeCalled()
expect(onPress).toHaveBeenCalled()
})
})
6 changes: 3 additions & 3 deletions src/components/__tests__/FilterButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ describe('FilterButton', () => {
test('Enabled', () => {
const { toJSON } = render(<FilterButton content={content} active onPress={onPress} style={{ flex: 1 }} />)
expect(toJSON()).toMatchSnapshot()
expect(content).toBeCalledWith({ color: theme.color.white })
expect(content).toHaveBeenCalledWith({ color: theme.color.white })
})

test('Disabled', () => {
const { toJSON } = render(<FilterButton content={content} active={false} style={{ flex: 1 }} />)
expect(toJSON()).toMatchSnapshot()
expect(content).toBeCalledWith({ color: theme.color.greyDark })
expect(content).toHaveBeenCalledWith({ color: theme.color.greyDark })
})
})

Expand All @@ -30,7 +30,7 @@ describe('FilterButton', () => {
<FilterButton content={content} active={false} onPress={onPress} style={{ flex: 1 }} />,
)
await fireEvent.press(getByText('Some text'))
expect(onPress).toBeCalled()
expect(onPress).toHaveBeenCalled()
})
})
})
4 changes: 2 additions & 2 deletions src/components/__tests__/LargeButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ describe('LargeButton', () => {
test('Click', async () => {
const { getByTestId } = render(<LargeButton title="Press me" onPress={onPress} style={{ flex: 1 }} />)
await fireEvent.press(getByTestId('touchable-opacity'))
expect(onPress).toBeCalled()
expect(onPress).toHaveBeenCalled()
})

test('onPressIn', async () => {
const { getByTestId } = render(
<LargeButton title="Press me" onPress={onPress} onPressIn={onPressIn} style={{ flex: 1 }} />,
)
await fireEvent(getByTestId('touchable-opacity'), 'pressIn')
expect(onPressIn).toBeCalled()
expect(onPressIn).toHaveBeenCalled()
})
})
2 changes: 1 addition & 1 deletion src/components/__tests__/MoreInfo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ describe('MoreInfo', () => {
test('Click', async () => {
const { getByText } = render(<MoreInfo onPress={onPress} containerStyle={{ flex: 1 }} label="About the species" />)
await fireEvent.press(getByText('About the species'))
expect(onPress).toBeCalled()
expect(onPress).toHaveBeenCalled()
})
})
6 changes: 3 additions & 3 deletions src/components/__tests__/NotificationPopup.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ describe('NotificationPopup', () => {
await fireEvent.press(getByTestId('close'))

// THEN
expect(buttonFunction1).toBeCalledTimes(1)
expect(buttonFunction2).toBeCalledTimes(1)
expect(onClose).toBeCalledTimes(1)
expect(buttonFunction1).toHaveBeenCalledTimes(1)
expect(buttonFunction2).toHaveBeenCalledTimes(1)
expect(onClose).toHaveBeenCalledTimes(1)
})
})
})
2 changes: 1 addition & 1 deletion src/components/__tests__/TextLink.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ describe('TextLink', () => {
<TextLink text="Text to click" onPress={onPress} containerStyle={{ flex: 1 }} textStyle={{ fontSize: 1 }} />,
)
await fireEvent.press(getByText('Text to click'))
expect(onPress).toBeCalled()
expect(onPress).toHaveBeenCalled()
})
})
4 changes: 2 additions & 2 deletions src/components/__tests__/ToolTip.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Tooltip', () => {
fireEvent.press(getByTestId('close'))

// THEN
expect(onCloseTooltip).toBeCalled()
expect(onCloseTooltip).toHaveBeenCalled()
})

test('Click on a button', () => {
Expand All @@ -65,7 +65,7 @@ describe('Tooltip', () => {
fireEvent.press(getByText('Action!'))

// THEN
expect(onPress).toBeCalled()
expect(onPress).toHaveBeenCalled()
})
})
})
2 changes: 1 addition & 1 deletion src/components/__tests__/WebLink.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ describe('WebLink', () => {
test('Click', async () => {
const { getByText } = render(<WebLink onPress={onPress} containerStyle={{ flex: 1 }} text="View on website" />)
await fireEvent.press(getByText('View on website'))
expect(onPress).toBeCalled()
expect(onPress).toHaveBeenCalled()
})
})
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Accordion Interaction Clicking on an 1st item twice, shows no body 1`] = `
<View>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`BackButton Rendering 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`BackgroundImage Rendering All props 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`BottomSheet Rendering Only buttons 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`BrandIcon Rendering Normal 1`] = `
<Icon
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Checkbox Rendering Checked state 1`] = `
<View
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/__snapshots__/Chip.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Chip Rendering All props 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`ContentImage Interaction Click the image to show the lightbox 1`] = `
<View
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/__snapshots__/Date.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Date Rendering 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Disclose Rendering Only text 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`DocumentLink Rendering 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`FilterButton Rendering Disabled 1`] = `
<View
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/__snapshots__/Icon.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Icon Light icon 1`] = `
<Icon
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`IconButton Rendering 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`IconView Rendering With default parameters 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`InputField Rendering Disabled 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`LargeButton Rendering, disabled, primary 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Lightbox Rendering Content that is dependent on the selected image 1`] = `
<Modal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Location Rendering 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Message Rendering With button 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`MoreInfo Rendering 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Notification Rendering 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`NotificationPopup Rendering Left and right buttons 1`] = `
<Modal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`PageIndicator Rendering Page 1/1 1`] = `
<View
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/__snapshots__/Panel.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Panel Rendering 1`] = `
<View
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/__snapshots__/Popup.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Popup Rendering 1`] = `
<Modal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`ProgressBarList Show bars 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`RenderHtmlWrapper Rendering Custom image renderer Normal render 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`TextLink Rendering disabled 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Tooltip Rendering With button 1`] = `
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`WebLink Rendering 1`] = `
<View
Expand Down
Loading