Skip to content

Commit

Permalink
Merge pull request #184 from BouyguesTelecom/fix/test-3
Browse files Browse the repository at this point in the history
Fix test / build
  • Loading branch information
hakaba authored Nov 4, 2024
2 parents 5d44b11 + 2136660 commit 1cc06f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/react/components/box/header/BoxHeaderProps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Box Header Interface
*/
import {Accessibility, Centerable, Position, TrilogyColor, TrilogyColorValues, VariantState, StatusState} from '@/objects'
import {Accessibility, Centerable, Position, VariantState, StatusState} from '@/objects'

export interface BoxHeaderProps extends Position, Centerable, Accessibility {
children?: React.ReactNode
Expand Down
9 changes: 5 additions & 4 deletions packages/react/components/box/test/Box.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { fireEvent, render, screen } from '@testing-library/react'
import {fireEvent, render, screen} from '@testing-library/react'
import * as React from 'react'
import Box from '../Box'
import { BoxMarkup } from '../BoxProps'
import { BoxContent, BoxFooter, BoxHeader, BoxTableContainer } from '../index'
import {BoxMarkup} from '../BoxProps'
import {BoxContent, BoxFooter, BoxHeader, BoxTableContainer} from '../index'
import BoxItem from '../item'
import {StatusState} from "../../../objects";

describe('Box component', () => {
test('renders without crashing', () => {
Expand Down Expand Up @@ -119,7 +120,7 @@ describe('Box component', () => {

test('Should have classes header', () => {
const { getByTestId } = render(
<BoxHeader testId='boxHeader' centered pulledLeft pulledRight variant='SUCCESS' help='HELP' />,
<BoxHeader testId='boxHeader' centered pulledLeft pulledRight variant={StatusState.SUCCESS} help='HELP' />,
)
const boxFooter = getByTestId('boxHeader')
const help = screen.getByTestId('boxHeader-help')
Expand Down
24 changes: 2 additions & 22 deletions packages/react/components/button/list/ButtonList.native.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,16 @@
import * as React from "react"
import { AutoLayoutWrapper } from "@/components/autolayout"
import { SpacerSize } from "@/components/spacer"
import { SpacingMatrixMode } from "@/components/autolayout/SpacingMatrix"

// eslint-disable-next-line no-duplicate-imports
import type { SpacingMatrix } from "@/components/autolayout/SpacingMatrix"
import { View } from '@/components/view'
import type { ButtonListProps } from "./ButtonListProps"
import { ComponentName } from "@/components/enumsComponentsName"

const { THREE, TWO } = SpacerSize
const { INSERT_SPACE_BETWEEN } = SpacingMatrixMode

const SPACING_MATRIX: SpacingMatrix = [
[INSERT_SPACE_BETWEEN, "Button", "Divider", TWO],
[INSERT_SPACE_BETWEEN, "Divider", "Button", TWO],
[INSERT_SPACE_BETWEEN, "Button", "Button", THREE],
]

/**
* ButtonList Native Component
* @param children {ReactNode} ButtonList children
* @param autolayout {boolean} Apply auto-layout rules
*/

/**
* @deprecated
*/
const ButtonList = ({
autolayout = SPACING_MATRIX,
children,
}: ButtonListProps): JSX.Element => {
return <AutoLayoutWrapper {...{ autolayout, children }} />
return <View {...{ children }} />
}

ButtonList.displayName = ComponentName.ButtonList
Expand Down

0 comments on commit 1cc06f1

Please sign in to comment.