From 6a1e0ba9b8036c07bc4615fbc07f22036ce365c8 Mon Sep 17 00:00:00 2001 From: Victoria Zhizhonkova Date: Mon, 16 Sep 2024 12:04:21 +0700 Subject: [PATCH] feat: add codemod tests --- .../horizontal-scroll/basic.input.tsx | 14 +++++++++-- .../__snapshots__/horizontal-scroll.ts.snap | 24 +++++++++++++++++++ .../src/components/HorizontalScroll/Readme.md | 10 ++++---- 3 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 packages/codemods/src/transforms/v7/__tests__/__snapshots__/horizontal-scroll.ts.snap diff --git a/packages/codemods/src/transforms/v7/__testfixtures__/horizontal-scroll/basic.input.tsx b/packages/codemods/src/transforms/v7/__testfixtures__/horizontal-scroll/basic.input.tsx index 4c9a1f16206..f88f364320a 100644 --- a/packages/codemods/src/transforms/v7/__testfixtures__/horizontal-scroll/basic.input.tsx +++ b/packages/codemods/src/transforms/v7/__testfixtures__/horizontal-scroll/basic.input.tsx @@ -1,10 +1,20 @@ -import { } from '@vkontakte/vkui'; +import { HorizontalScroll } from '@vkontakte/vkui'; import React from 'react'; +import '@vkontakte/vkui/dist/vkui.css'; const App = () => { return ( - + +
+
+
+ + +
+
+
+ ); }; diff --git a/packages/codemods/src/transforms/v7/__tests__/__snapshots__/horizontal-scroll.ts.snap b/packages/codemods/src/transforms/v7/__tests__/__snapshots__/horizontal-scroll.ts.snap new file mode 100644 index 00000000000..6509fac04ab --- /dev/null +++ b/packages/codemods/src/transforms/v7/__tests__/__snapshots__/horizontal-scroll.ts.snap @@ -0,0 +1,24 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`horizontal-scroll transforms correctly 1`] = ` +"import { HorizontalScroll } from '@vkontakte/vkui'; +import React from 'react'; +import '@vkontakte/vkui/dist/vkui.css'; + +const App = () => { + return ( + ( + +
+
+
+ + +
+
+
+ + ) + ); +};" +`; diff --git a/packages/vkui/src/components/HorizontalScroll/Readme.md b/packages/vkui/src/components/HorizontalScroll/Readme.md index c2d34e5935d..61f7fb67a42 100644 --- a/packages/vkui/src/components/HorizontalScroll/Readme.md +++ b/packages/vkui/src/components/HorizontalScroll/Readme.md @@ -171,12 +171,10 @@ const RandomUsers = () => { ```tsx static - - 1 - 2 - 3 - - + 1 + 2 + 3 + ```