diff --git a/src/components/ActionSheet/__image_snapshots__/actionsheet-android-bright_light-1-snap.png b/src/components/ActionSheet/__image_snapshots__/actionsheet-android-bright_light-1-snap.png index 12313db8df8..fbdf0af31d7 100644 --- a/src/components/ActionSheet/__image_snapshots__/actionsheet-android-bright_light-1-snap.png +++ b/src/components/ActionSheet/__image_snapshots__/actionsheet-android-bright_light-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9d25daa70da20d2384b76e82dd442c84a3d8c8e140040dd39982cde26c0a9ec8 -size 15964 +oid sha256:2c94af9612adeb16508c4ecfc94313b82678782b4c22902acb855e05acace613 +size 15943 diff --git a/src/components/ActionSheet/__image_snapshots__/actionsheet-android-space_gray-1-snap.png b/src/components/ActionSheet/__image_snapshots__/actionsheet-android-space_gray-1-snap.png index 4f52879a00f..9dc310d3769 100644 --- a/src/components/ActionSheet/__image_snapshots__/actionsheet-android-space_gray-1-snap.png +++ b/src/components/ActionSheet/__image_snapshots__/actionsheet-android-space_gray-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c81f04a4778bcf25d4f5b71b900d2fae847595177de2334284cf8001e30e724b -size 15639 +oid sha256:b7061b81e9b66129affa3a037bfaa356111168272faa5f56253319d6ea37098a +size 14631 diff --git a/src/components/ActionSheet/__image_snapshots__/actionsheet-ios-bright_light-1-snap.png b/src/components/ActionSheet/__image_snapshots__/actionsheet-ios-bright_light-1-snap.png index a86bbcaf8bf..e53a46b2a84 100644 --- a/src/components/ActionSheet/__image_snapshots__/actionsheet-ios-bright_light-1-snap.png +++ b/src/components/ActionSheet/__image_snapshots__/actionsheet-ios-bright_light-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b5c1453fc4d88f11fe9a738f747ccdc6ab066e62a62568c69e963a06d91e7940 -size 20873 +oid sha256:a6add7cc20c183ef8875183d1498b755b77af714116a2c165bb469759d80414b +size 18053 diff --git a/src/components/ActionSheet/__image_snapshots__/actionsheet-ios-space_gray-1-snap.png b/src/components/ActionSheet/__image_snapshots__/actionsheet-ios-space_gray-1-snap.png index 19c6e11b25e..cb52e4dd0be 100644 --- a/src/components/ActionSheet/__image_snapshots__/actionsheet-ios-space_gray-1-snap.png +++ b/src/components/ActionSheet/__image_snapshots__/actionsheet-ios-space_gray-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4e5862c0af423220b44a802c917efb5a8d040dbecd4a3f50b48353372c39b686 -size 20852 +oid sha256:a11df79f0dd2debdc4f36df1b2c515739d712b0789591e65b8cc34438ad88098 +size 17361 diff --git a/src/components/ActionSheet/__image_snapshots__/actionsheet-vkcom-space_gray-1-snap.png b/src/components/ActionSheet/__image_snapshots__/actionsheet-vkcom-space_gray-1-snap.png deleted file mode 100644 index 8156a2db7fd..00000000000 --- a/src/components/ActionSheet/__image_snapshots__/actionsheet-vkcom-space_gray-1-snap.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7ae34315456328c2c65c5b6b67c5eae40ae2294ebe1358fbf83ab54dcbe4d191 -size 14707 diff --git a/src/components/Button/__image_snapshots__/button-android-bright_light-1-snap.png b/src/components/Button/__image_snapshots__/button-android-bright_light-1-snap.png index 75ad8d1e22e..31a5a2654d0 100644 --- a/src/components/Button/__image_snapshots__/button-android-bright_light-1-snap.png +++ b/src/components/Button/__image_snapshots__/button-android-bright_light-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6de789edce86e276e3ab87a1734fa92f6bab564f19aeb9a3773f560392fa304a -size 75941 +oid sha256:5b0c2dfb8b538d1b37bcced7fccf4d9d9218fbe4b06ad17a1628bbc0716350f8 +size 78567 diff --git a/src/components/Button/__image_snapshots__/button-android-space_gray-1-snap.png b/src/components/Button/__image_snapshots__/button-android-space_gray-1-snap.png index 459caf52377..bc86f680ad2 100644 --- a/src/components/Button/__image_snapshots__/button-android-space_gray-1-snap.png +++ b/src/components/Button/__image_snapshots__/button-android-space_gray-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7bce2c1c043d58c8ab7ea9bd741a403f25c6f8924577fcd3f65fd19fb879dbcc -size 84125 +oid sha256:f5155c5297204893bfbe9d03ba9a39dee5ff0c1fa38164609bce3b0882341258 +size 79726 diff --git a/src/components/Button/__image_snapshots__/button-ios-bright_light-1-snap.png b/src/components/Button/__image_snapshots__/button-ios-bright_light-1-snap.png index dbcc86fafc5..25b51496ac7 100644 --- a/src/components/Button/__image_snapshots__/button-ios-bright_light-1-snap.png +++ b/src/components/Button/__image_snapshots__/button-ios-bright_light-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e67a01450a58bc33f2938dc12b7e16c688f5ad6907892b63cb94265778ae31e0 -size 77137 +oid sha256:c2e142b478f96021e1b95976d44d5b73fe321e867959db3d47c7bc41c2d414b1 +size 80272 diff --git a/src/components/Button/__image_snapshots__/button-ios-space_gray-1-snap.png b/src/components/Button/__image_snapshots__/button-ios-space_gray-1-snap.png index 78a5f7cf244..1e99ac76a5f 100644 --- a/src/components/Button/__image_snapshots__/button-ios-space_gray-1-snap.png +++ b/src/components/Button/__image_snapshots__/button-ios-space_gray-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9bce185c18b4e328e45e77091e1fbe436a441a555f4dfbe93ec9ad550f19350b -size 85734 +oid sha256:f50a393f4e5ded744bc43f650bd14487123489430c7f2d1d2f31677025833027 +size 81398 diff --git a/src/components/Button/__image_snapshots__/button-vkcom-bright_light-1-snap.png b/src/components/Button/__image_snapshots__/button-vkcom-bright_light-1-snap.png index 222fb55d0db..09c68ccc77b 100644 --- a/src/components/Button/__image_snapshots__/button-vkcom-bright_light-1-snap.png +++ b/src/components/Button/__image_snapshots__/button-vkcom-bright_light-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4238c70653c363d8ff3a5abbf2e15f461c3b45bb65da157ef6d89b8b908bfd5d -size 56545 +oid sha256:017c34644958e64c2adeb411f6b6e8ebd9eb0097e64947f803c6f76b8968c36e +size 56721 diff --git a/src/components/Button/__image_snapshots__/button-vkcom-space_gray-1-snap.png b/src/components/Button/__image_snapshots__/button-vkcom-space_gray-1-snap.png deleted file mode 100644 index 49f6c2c36a0..00000000000 --- a/src/components/Button/__image_snapshots__/button-vkcom-space_gray-1-snap.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f7081a3331d08f7071408c8336534bed3b3d113f5bf988f0e1a7d68510d21d44 -size 62386 diff --git a/src/components/Checkbox/__image_snapshots__/checkbox-android-bright_light-1-snap.png b/src/components/Checkbox/__image_snapshots__/checkbox-android-bright_light-1-snap.png index 5cee532acbb..1bb380090d5 100644 --- a/src/components/Checkbox/__image_snapshots__/checkbox-android-bright_light-1-snap.png +++ b/src/components/Checkbox/__image_snapshots__/checkbox-android-bright_light-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:434bc0ed37278d459cf20452f49671b48ce110e7b87ed658d3daa455914528a8 -size 11022 +oid sha256:bbefb6ac20ccb8bf982215519f5606b64803585d790f687aac2df7ad8fac33b6 +size 11266 diff --git a/src/components/Checkbox/__image_snapshots__/checkbox-android-space_gray-1-snap.png b/src/components/Checkbox/__image_snapshots__/checkbox-android-space_gray-1-snap.png index 1bde6de901b..cc4a12c276d 100644 --- a/src/components/Checkbox/__image_snapshots__/checkbox-android-space_gray-1-snap.png +++ b/src/components/Checkbox/__image_snapshots__/checkbox-android-space_gray-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:21473d58d7ef7d84c7e5bb198fb7b08d14c498ea95c3c9460ca1acf114be5c13 -size 11261 +oid sha256:97dd125e41e836640a49a0a5b7d642f3661dc034fb7ebedbac8555d8b1d54885 +size 11179 diff --git a/src/components/Checkbox/__image_snapshots__/checkbox-ios-bright_light-1-snap.png b/src/components/Checkbox/__image_snapshots__/checkbox-ios-bright_light-1-snap.png index 62d681530dc..9bd8b57cd16 100644 --- a/src/components/Checkbox/__image_snapshots__/checkbox-ios-bright_light-1-snap.png +++ b/src/components/Checkbox/__image_snapshots__/checkbox-ios-bright_light-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:76a6fba012e7fb686ab15a9f2addf03d4664917b2252475879c7173b5db60206 -size 11024 +oid sha256:0191d6470c3abb92c8dbaf19bfa06f9799a460fb7634af76fdcc754fb40cc4e0 +size 11280 diff --git a/src/components/Checkbox/__image_snapshots__/checkbox-ios-space_gray-1-snap.png b/src/components/Checkbox/__image_snapshots__/checkbox-ios-space_gray-1-snap.png index 84d2b6a551f..add1753d8df 100644 --- a/src/components/Checkbox/__image_snapshots__/checkbox-ios-space_gray-1-snap.png +++ b/src/components/Checkbox/__image_snapshots__/checkbox-ios-space_gray-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8aa4ebbf5da2145d0716fb6d4db602f94726c7905ea309d3da63ddebdeaccc2a -size 11270 +oid sha256:60953089f6a0365d58a0462312142e7221c3f433dc9fa7747c988373eb8aaa38 +size 11188 diff --git a/src/components/Checkbox/__image_snapshots__/checkbox-vkcom-bright_light-1-snap.png b/src/components/Checkbox/__image_snapshots__/checkbox-vkcom-bright_light-1-snap.png index ec78290ab93..b5f138d916c 100644 --- a/src/components/Checkbox/__image_snapshots__/checkbox-vkcom-bright_light-1-snap.png +++ b/src/components/Checkbox/__image_snapshots__/checkbox-vkcom-bright_light-1-snap.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:be920bde955a9630a2057de7ed69101b621313fe5417304341954b3a771c3428 -size 8793 +oid sha256:96c652a5ec7d9bbfc4eb76429e4b10db6dfb21a579dec86196071a1991cf2d3b +size 8744 diff --git a/src/components/Checkbox/__image_snapshots__/checkbox-vkcom-space_gray-1-snap.png b/src/components/Checkbox/__image_snapshots__/checkbox-vkcom-space_gray-1-snap.png deleted file mode 100644 index 01cb4f1b18e..00000000000 --- a/src/components/Checkbox/__image_snapshots__/checkbox-vkcom-space_gray-1-snap.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3fae19a5cf0002cf15e32bbad0a103cc2124070b1bcb45af203ae16ce1e8630d -size 9357 diff --git a/src/testing/e2e/utils.tsx b/src/testing/e2e/utils.tsx index 28e2880620b..706712cd034 100644 --- a/src/testing/e2e/utils.tsx +++ b/src/testing/e2e/utils.tsx @@ -7,6 +7,7 @@ import { Platform } from '../../lib/platform'; import { Scheme } from '../../components/ConfigProvider/ConfigProviderContext'; import AdaptivityProvider, { AdaptivityProviderProps } from '../../components/AdaptivityProvider/AdaptivityProvider'; import { SizeType } from '../../components/AdaptivityProvider/AdaptivityContext'; +import { AdaptivityProps } from 'index'; type AdaptivityFlag = boolean | 'x' | 'y'; type PropDesc = { [K in keyof Props]?: Array } & { $adaptivity?: AdaptivityFlag }; @@ -64,10 +65,9 @@ type ScreenshotOptions = { matchScreenshot?: MatchImageSnapshotOptions; platforms?: Platform[]; schemes?: Scheme[]; + adaptivity?: AdaptivityProps; }; -const CompactProvider: React.ComponentType = ({ children }) => ( - {children} -); + export function describeScreenshotFuzz( Component: ComponentType, propSets: Array> = [], @@ -77,18 +77,21 @@ export function describeScreenshotFuzz( matchScreenshot, platforms = Object.values(Platform), schemes = [Scheme.BRIGHT_LIGHT, Scheme.SPACE_GRAY], + adaptivity = {}, } = options; platforms.forEach((platform) => { describe(platform, () => { const isVkCom = platform === 'vkcom'; - const width = isVkCom ? 'auto' : 320; - const ForceAdaptivity = isVkCom ? CompactProvider : Fragment; - schemes.forEach((scheme) => { + const width = adaptivity.viewWidth || (isVkCom ? 'auto' : 320); + const adaptivityProps = Object.assign( + isVkCom ? { sizeX: SizeType.COMPACT, sizeY: SizeType.COMPACT } : {}, + adaptivity); + (isVkCom ? [Scheme.BRIGHT_LIGHT] : schemes).forEach((scheme) => { it(scheme, async () => { expect(await screenshot((
- + {multiCartesian(propSets, { adaptive: !isVkCom }).map((props, i) => ( @@ -97,7 +100,7 @@ export function describeScreenshotFuzz( ))} - +
))).toMatchImageSnapshot(matchScreenshot);