@planningcenter/chat-react-native 4.8.0-rc.7 → 4.8.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "4.8.0-rc.7",
3
+ "version": "4.8.0-rc.8",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -84,5 +84,5 @@
84
84
  "sf-symbols-typescript": "^2.2.0",
85
85
  "typescript": "~6.0.3"
86
86
  },
87
- "gitHead": "a39a1afc855ec657bb6934df06860a23b356eaab"
87
+ "gitHead": "048d49b0bab4af43ded2adbe9193da851d415cb1"
88
88
  }
@@ -0,0 +1,33 @@
1
+ import { render } from '@testing-library/react-native'
2
+ import React from 'react'
3
+ import { StyleSheet } from 'react-native'
4
+ import { faBoxArchive } from '../../../vendor/font_awesome_pro_solid_icons'
5
+ import { IconTile } from '../icon_tile'
6
+
7
+ const clippingAncestors = (shape: 'circle' | 'square') => {
8
+ const view = render(
9
+ <IconTile icon={faBoxArchive} shape={shape} maxFontSizeMultiplier={1} testID="tile" />
10
+ )
11
+ const ancestors = []
12
+ let node = view.getByTestId('tile', { includeHiddenElements: true }).parent
13
+ while (node) {
14
+ ancestors.push(node)
15
+ node = node.parent
16
+ }
17
+
18
+ return ancestors.filter(
19
+ ancestor =>
20
+ typeof ancestor.type === 'string' &&
21
+ StyleSheet.flatten(ancestor.props.style)?.overflow === 'hidden'
22
+ )
23
+ }
24
+
25
+ describe('IconTile', () => {
26
+ it('masks a circle tile', () => {
27
+ expect(clippingAncestors('circle')).not.toHaveLength(0)
28
+ })
29
+
30
+ it('keeps a square tile out of the circular mask', () => {
31
+ expect(clippingAncestors('square')).toHaveLength(0)
32
+ })
33
+ })