From 45b1676ade4527a0e89c536eabb6ee1e8955c5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Cavaleiro?= <43344587+jpcav21@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:01:57 +0100 Subject: [PATCH 1/2] feat(text): [DSM-835] add tests (#807) * feat(text): [DSM-835] add tests * added new test and refactored others --- malty/atoms/Text/Text.test.tsx | 29 ++++++++++++++++++++++++++--- malty/atoms/Text/Text.tsx | 1 - 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/malty/atoms/Text/Text.test.tsx b/malty/atoms/Text/Text.test.tsx index b6f656b25..3cfdb594e 100644 --- a/malty/atoms/Text/Text.test.tsx +++ b/malty/atoms/Text/Text.test.tsx @@ -5,10 +5,33 @@ import { TextStyle } from '.'; import { Text } from './Text'; const text = 'this is a text block'; -describe('text', () => { +const testId = 'text'; + +describe('Text', () => { it('should render with the correct text', () => { render({text}); - const rendered = screen.getByText(text); - expect(rendered).toBeInTheDocument(); + + expect(screen.getByText(text)).toBeInTheDocument(); + }); + + it('should have the assigned data test id', () => { + render( + + {text} + + ); + + expect(screen.getByTestId(testId)).toBeInTheDocument(); + }); + + it('should render children element', () => { + render( + + {text} + + ); + + expect(screen.getByTestId('span')).toBeInTheDocument(); + expect(screen.getByTestId(testId)).toBeInTheDocument(); }); }); diff --git a/malty/atoms/Text/Text.tsx b/malty/atoms/Text/Text.tsx index c8f3e5764..c8d7257d6 100644 --- a/malty/atoms/Text/Text.tsx +++ b/malty/atoms/Text/Text.tsx @@ -37,7 +37,6 @@ export const Text = ({ theme={theme} as={StyledTag} className={className} - // eslint-disable-next-line react/jsx-props-no-spreading {...props} > {children} From fb11e8c9f68ae1116680e46ba67b537a083cddba Mon Sep 17 00:00:00 2001 From: "carlsberg-release-app[bot]" Date: Mon, 16 Oct 2023 16:16:47 +0000 Subject: [PATCH 2/2] release: Bit GitHub Action (automated) [skip ci] --- .bitmap | 66 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.bitmap b/.bitmap index 31418abd2..081d38d0e 100644 --- a/.bitmap +++ b/.bitmap @@ -11,25 +11,25 @@ { "atoms/button": { "scope": "carlsberggroup.malty", - "version": "0.0.100", + "version": "0.0.101", "mainFile": "index.ts", "rootDir": "malty/atoms/Button" }, "atoms/card": { "scope": "carlsberggroup.malty", - "version": "0.0.16", + "version": "0.0.17", "mainFile": "index.ts", "rootDir": "malty/atoms/Card" }, "atoms/checkbox": { "scope": "carlsberggroup.malty", - "version": "0.0.67", + "version": "0.0.68", "mainFile": "index.ts", "rootDir": "malty/atoms/Checkbox" }, "atoms/chip": { "scope": "carlsberggroup.malty", - "version": "0.0.57", + "version": "0.0.58", "mainFile": "index.ts", "rootDir": "malty/atoms/Chip" }, @@ -107,7 +107,7 @@ }, "atoms/price": { "scope": "carlsberggroup.malty", - "version": "0.0.7", + "version": "0.0.8", "mainFile": "index.ts", "rootDir": "malty/atoms/Price" }, @@ -119,7 +119,7 @@ }, "atoms/progress-circle": { "scope": "carlsberggroup.malty", - "version": "0.0.8", + "version": "0.0.9", "mainFile": "index.ts", "rootDir": "malty/atoms/ProgressCircle" }, @@ -137,19 +137,19 @@ }, "atoms/rating": { "scope": "carlsberggroup.malty", - "version": "0.0.32", + "version": "0.0.33", "mainFile": "index.ts", "rootDir": "malty/atoms/Rating" }, "atoms/select": { "scope": "carlsberggroup.malty", - "version": "0.0.107", + "version": "0.0.108", "mainFile": "index.ts", "rootDir": "malty/atoms/Select" }, "atoms/text": { "scope": "carlsberggroup.malty", - "version": "0.0.64", + "version": "0.0.65", "mainFile": "index.ts", "rootDir": "malty/atoms/Text" }, @@ -167,7 +167,7 @@ }, "atoms/tooltip": { "scope": "carlsberggroup.malty", - "version": "0.0.87", + "version": "0.0.88", "mainFile": "index.ts", "rootDir": "malty/atoms/Tooltip" }, @@ -1487,139 +1487,139 @@ }, "molecules/accordion": { "scope": "carlsberggroup.malty", - "version": "0.0.38", + "version": "0.0.39", "mainFile": "index.ts", "rootDir": "malty/molecules/Accordion" }, "molecules/alert-banner": { "scope": "carlsberggroup.malty", - "version": "0.0.90", + "version": "0.0.91", "mainFile": "index.ts", "rootDir": "malty/molecules/AlertBanner" }, "molecules/alert-inline": { "scope": "carlsberggroup.malty", - "version": "0.0.58", + "version": "0.0.59", "mainFile": "index.ts", "rootDir": "malty/molecules/AlertInline" }, "molecules/article-card": { "scope": "carlsberggroup.malty", - "version": "0.0.12", + "version": "0.0.13", "mainFile": "index.ts", "rootDir": "malty/molecules/ArticleCard" }, "molecules/avatar": { "scope": "carlsberggroup.malty", - "version": "0.0.51", + "version": "0.0.52", "mainFile": "index.tsx", "rootDir": "malty/molecules/Avatar" }, "molecules/banner": { "scope": "carlsberggroup.malty", - "version": "0.0.17", + "version": "0.0.18", "mainFile": "index.ts", "rootDir": "malty/molecules/Banner" }, "molecules/datepicker": { "scope": "carlsberggroup.malty", - "version": "0.0.69", + "version": "0.0.70", "mainFile": "index.ts", "rootDir": "malty/molecules/Datepicker" }, "molecules/footer": { "scope": "carlsberggroup.malty", - "version": "0.0.17", + "version": "0.0.18", "mainFile": "index.ts", "rootDir": "malty/molecules/Footer" }, "molecules/hero": { "scope": "carlsberggroup.malty", - "version": "0.0.14", + "version": "0.0.15", "mainFile": "index.ts", "rootDir": "malty/molecules/Hero" }, "molecules/loading": { "scope": "carlsberggroup.malty", - "version": "0.0.75", + "version": "0.0.76", "mainFile": "index.ts", "rootDir": "malty/molecules/Loading" }, "molecules/modal": { "scope": "carlsberggroup.malty", - "version": "0.0.77", + "version": "0.0.78", "mainFile": "index.ts", "rootDir": "malty/molecules/Modal" }, "molecules/nav-list": { "scope": "carlsberggroup.malty", - "version": "0.0.59", + "version": "0.0.60", "mainFile": "index.tsx", "rootDir": "malty/molecules/NavList" }, "molecules/pagination": { "scope": "carlsberggroup.malty", - "version": "0.0.80", + "version": "0.0.81", "mainFile": "index.ts", "rootDir": "malty/molecules/Pagination" }, "molecules/product-card": { "scope": "carlsberggroup.malty", - "version": "0.0.42", + "version": "0.0.43", "mainFile": "index.ts", "rootDir": "malty/molecules/ProductCard" }, "molecules/product-quantity-actions": { "scope": "carlsberggroup.malty", - "version": "0.0.21", + "version": "0.0.22", "mainFile": "index.ts", "rootDir": "malty/molecules/ProductQuantityActions" }, "molecules/products-bar": { "scope": "carlsberggroup.malty", - "version": "0.0.60", + "version": "0.0.61", "mainFile": "index.tsx", "rootDir": "malty/molecules/ProductsBar" }, "molecules/segmented-control": { "scope": "carlsberggroup.malty", - "version": "0.0.13", + "version": "0.0.14", "mainFile": "index.ts", "rootDir": "malty/molecules/SegmentedControl" }, "molecules/side-nav": { "scope": "carlsberggroup.malty", - "version": "0.0.66", + "version": "0.0.67", "mainFile": "index.tsx", "rootDir": "malty/molecules/SideNav" }, "molecules/sku": { "scope": "carlsberggroup.malty", - "version": "0.0.9", + "version": "0.0.10", "mainFile": "index.ts", "rootDir": "malty/molecules/Sku" }, "molecules/stepper": { "scope": "carlsberggroup.malty", - "version": "0.0.73", + "version": "0.0.74", "mainFile": "index.ts", "rootDir": "malty/molecules/Stepper" }, "molecules/toast": { "scope": "carlsberggroup.malty", - "version": "0.0.66", + "version": "0.0.67", "mainFile": "index.ts", "rootDir": "malty/molecules/Toast" }, "organisms/carousel": { "scope": "carlsberggroup.malty", - "version": "0.0.25", + "version": "0.0.26", "mainFile": "index.ts", "rootDir": "malty/organisms/Carousel" }, "organisms/table": { "scope": "carlsberggroup.malty", - "version": "0.1.5", + "version": "0.1.6", "mainFile": "index.ts", "rootDir": "malty/organisms/Table" },