@times-components/ts-components 1.104.1-alpha.86 → 1.104.1-alpha.88

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.
@@ -20,15 +20,17 @@ export type FeaturesCarouselItemProps = {
20
20
  type FeaturesCarouselProps = {
21
21
  heading: string;
22
22
  carouselItems: FeaturesCarouselItemProps[];
23
+ hideHeading: boolean;
23
24
  };
24
25
 
25
26
  export const FeaturesCarousel: React.FC<FeaturesCarouselProps> = ({
26
27
  heading,
27
- carouselItems
28
+ carouselItems,
29
+ hideHeading
28
30
  }) =>
29
31
  carouselItems ? (
30
32
  <div id="benefits-carousel">
31
- <Header>{heading}</Header>
33
+ {hideHeading && <Header>{heading}</Header>}
32
34
  <FeaturesCarouselContainer>
33
35
  <FeaturesCarouselWindow>
34
36
  {carouselItems.map(carouselItem => (
@@ -5,8 +5,10 @@ import { FeaturesCarousel } from '../FeaturesCarousel';
5
5
  import { featuresCarouselData } from '../fixtureData.json';
6
6
 
7
7
  describe('Render FeaturesCarousel', () => {
8
- const renderFeaturesCarousel = () =>
9
- render(<FeaturesCarousel {...featuresCarouselData} />);
8
+ const renderFeaturesCarousel = (hideHeading: boolean = true) =>
9
+ render(
10
+ <FeaturesCarousel {...featuresCarouselData} hideHeading={hideHeading} />
11
+ );
10
12
 
11
13
  it('should render a snapshot', () => {
12
14
  const { asFragment } = renderFeaturesCarousel();
@@ -16,7 +18,18 @@ describe('Render FeaturesCarousel', () => {
16
18
  it('should render the component', () => {
17
19
  const { getByText } = renderFeaturesCarousel();
18
20
  const getFirstTitle = getByText('Title 1');
21
+ const getHeading = getByText('Your benefits');
19
22
  expect(getFirstTitle).toBeInTheDocument();
23
+ expect(getHeading).toBeInTheDocument();
24
+ });
25
+
26
+ it('should render the component without heading', () => {
27
+ const { getByText, queryByText } = renderFeaturesCarousel(false);
28
+ const getFirstTitle = getByText('Title 1');
29
+ const getHeading = queryByText('Your benefits');
30
+
31
+ expect(getFirstTitle).toBeInTheDocument();
32
+ expect(getHeading).toBeNull();
20
33
  });
21
34
 
22
35
  it('items should have link with href', () => {
@@ -24,7 +24,7 @@ An example of the `data` structure can be found in the 'Controls' section on the
24
24
  Please click the 'Canvas' tab for a better viewing experience, where you can update the props and review at the different breakpoints by clicking the preview icon and selecting from our list of pre-defined breakpoints (XS, SM, MD, LG and XL).
25
25
 
26
26
  export const FeaturesCarouselStory = ({ featuresCarouselData }) => (
27
- <FeaturesCarousel heading={featuresCarouselData.heading} carouselItems={featuresCarouselData.carouselItems} />
27
+ <FeaturesCarousel heading={featuresCarouselData.heading} carouselItems={featuresCarouselData.carouselItems} hideHeading={featuresCarouselData.hideHeading} />
28
28
  );
29
29
 
30
30
  <Story name="FeaturesCarousel" args={{ featuresCarouselData }}>
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "featuresCarouselData": {
3
+ "hideHeading": false,
3
4
  "heading": "Your benefits",
4
5
  "carouselItems": [
5
6
  {
@@ -76,6 +76,8 @@ export const AllowButton = styled.button`
76
76
  justify-content: center;
77
77
  margin-top: 12px;
78
78
  padding: 8px 12px;
79
+ border-radius: 0px;
80
+ border-width: 1px;
79
81
  `;
80
82
 
81
83
  export const LinkPrivacyManager = styled.a`