redbadger/pride-london-app

View on GitHub
src/screens/HomeScreen/__snapshots__/component.test.js.snap

Summary

Maintainability
Test Coverage
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`HomeScreen Component renders correctly 1`] = `
<ScrollView
  style={
    Object {
      "backgroundColor": "#ffffff",
    }
  }
  testID="home-screen"
>
  <View
    style={
      Object {
        "backgroundColor": "#ffffff",
      }
    }
  >
    <Header
      getImageDetails={[MockFunction]}
      headerBanners={
        Array [
          Object {
            "contentType": "headerBanner",
            "fields": Object {
              "backgroundColour": "#ff0000",
              "heading": "heading",
              "headingLine2": "headingLine2",
              "heroImage": Object {
                "sys": Object {
                  "id": "2re6B7z5h1VJ0y",
                },
              },
              "subHeading": "subHeading",
            },
            "id": "g3QY",
            "locale": "en-GB",
            "revision": 1,
          },
          Object {
            "contentType": "headerBanner",
            "fields": Object {
              "backgroundColour": "#ff0000",
              "heading": "heading",
              "headingLine2": "headingLine2",
              "heroImage": Object {
                "sys": Object {
                  "id": "X4El6Ef26uBA32r",
                },
              },
              "subHeading": "subHeading",
            },
            "id": "G36Nw4N4Qb1HE305M0V",
            "locale": "en-GB",
            "revision": 1,
          },
        ]
      }
      navigation={
        Object {
          "navigate": [MockFunction],
        }
      }
    />
    <ContentPadding
      padding={Object {}}
      style={
        Object {
          "alignSelf": "center",
          "maxWidth": 440,
        }
      }
    >
      <View
        style={
          Object {
            "alignItems": "center",
            "flexDirection": "row",
            "justifyContent": "space-between",
            "marginTop": 12,
          }
        }
      >
        <Text
          color="blackColor"
          markdown={false}
          markdownStyle={Object {}}
          style={
            Object {
              "color": "rgb(45, 47, 127)",
            }
          }
          type="h2"
        >
          Featured events
        </Text>
        <Touchable
          accessibilityComponentType="button"
          accessibilityTraits={
            Array [
              "button",
            ]
          }
          delayPressIn={50}
          onPress={[Function]}
          testID="view-all"
        >
          <TextLink>
            View all
          </TextLink>
        </Touchable>
      </View>
      <View
        style={
          Object {
            "flexDirection": "row",
            "flexWrap": "wrap",
          }
        }
      >
        <View
          key="hG"
          style={
            Array [
              Object {
                "marginBottom": 12,
                "width": "50%",
              },
              Object {
                "paddingRight": 8,
              },
            ]
          }
        >
          <Touchable
            accessibilityComponentType="button"
            accessibilityTraits={
              Array [
                "button",
              ]
            }
            delayPressIn={50}
            onPress={[Function]}
            style={
              Object {
                "backgroundColor": "#ffffff",
                "borderRadius": 3,
                "borderWidth": 0,
                "elevation": 3,
                "flex": 1,
                "justifyContent": "flex-start",
                "shadowColor": "rgba(0, 0, 0, 0.2)",
                "shadowOffset": Object {
                  "height": 1,
                  "width": 0,
                },
                "shadowOpacity": 1,
                "shadowRadius": 3,
              }
            }
            testID="event-tile-0"
          >
            <EventTile
              date="2018-07-07T00:00+00:00"
              eventCategories={
                Array [
                  "Social and Networking",
                  "Talks and Debates",
                ]
              }
              imageReference={
                Object {
                  "sys": Object {
                    "id": "8iB636ntgq3B632hFy6uHIt7kC",
                  },
                }
              }
              name="name"
            />
          </Touchable>
        </View>
        <View
          key="5obj688Cj3vM"
          style={
            Array [
              Object {
                "marginBottom": 12,
                "width": "50%",
              },
              false,
            ]
          }
        >
          <Touchable
            accessibilityComponentType="button"
            accessibilityTraits={
              Array [
                "button",
              ]
            }
            delayPressIn={50}
            onPress={[Function]}
            style={
              Object {
                "backgroundColor": "#ffffff",
                "borderRadius": 3,
                "borderWidth": 0,
                "elevation": 3,
                "flex": 1,
                "justifyContent": "flex-start",
                "shadowColor": "rgba(0, 0, 0, 0.2)",
                "shadowOffset": Object {
                  "height": 1,
                  "width": 0,
                },
                "shadowOpacity": 1,
                "shadowRadius": 3,
              }
            }
            testID="event-tile-1"
          >
            <EventTile
              date="2018-07-07T00:00+00:00"
              eventCategories={
                Array [
                  "Cabaret and Variety",
                  "Health",
                  "Nightlife",
                  "Music",
                  "Talks and Debates",
                ]
              }
              imageReference={
                Object {
                  "sys": Object {
                    "id": "b8Gmbw5l8QQWmULc94kd5U4",
                  },
                }
              }
              name="name"
            />
          </Touchable>
        </View>
        <View
          key="Ii3rT8J7D7oRAsi73e2G"
          style={
            Array [
              Object {
                "marginBottom": 12,
                "width": "50%",
              },
              Object {
                "paddingRight": 8,
              },
            ]
          }
        >
          <Touchable
            accessibilityComponentType="button"
            accessibilityTraits={
              Array [
                "button",
              ]
            }
            delayPressIn={50}
            onPress={[Function]}
            style={
              Object {
                "backgroundColor": "#ffffff",
                "borderRadius": 3,
                "borderWidth": 0,
                "elevation": 3,
                "flex": 1,
                "justifyContent": "flex-start",
                "shadowColor": "rgba(0, 0, 0, 0.2)",
                "shadowOffset": Object {
                  "height": 1,
                  "width": 0,
                },
                "shadowOpacity": 1,
                "shadowRadius": 3,
              }
            }
            testID="event-tile-2"
          >
            <EventTile
              date="2018-07-07T00:00+00:00"
              eventCategories={
                Array [
                  "Talks and Debates",
                  "Sports and Activities",
                ]
              }
              imageReference={
                Object {
                  "sys": Object {
                    "id": "brWIC",
                  },
                }
              }
              name="name"
            />
          </Touchable>
        </View>
        <View
          key="24f3tJ9kLEIsCL0O8y881NG4pjYP2"
          style={
            Array [
              Object {
                "marginBottom": 12,
                "width": "50%",
              },
              false,
            ]
          }
        >
          <Touchable
            accessibilityComponentType="button"
            accessibilityTraits={
              Array [
                "button",
              ]
            }
            delayPressIn={50}
            onPress={[Function]}
            style={
              Object {
                "backgroundColor": "#ffffff",
                "borderRadius": 3,
                "borderWidth": 0,
                "elevation": 3,
                "flex": 1,
                "justifyContent": "flex-start",
                "shadowColor": "rgba(0, 0, 0, 0.2)",
                "shadowOffset": Object {
                  "height": 1,
                  "width": 0,
                },
                "shadowOpacity": 1,
                "shadowRadius": 3,
              }
            }
            testID="event-tile-3"
          >
            <EventTile
              date="2018-07-07T00:00+00:00"
              eventCategories={
                Array [
                  "Social and Networking",
                  "Nightlife",
                  "Music",
                  "Community",
                  "Film and Screenings",
                ]
              }
              imageReference={
                Object {
                  "sys": Object {
                    "id": "H7xkAV37pJQ8Wj6g8wEd",
                  },
                }
              }
              name="name"
            />
          </Touchable>
        </View>
      </View>
    </ContentPadding>
    <View
      style={
        Object {
          "height": 42,
          "marginBottom": 16,
          "marginTop": 12,
        }
      }
    >
      <View
        style={
          Object {
            "backgroundColor": "#2d2f7f",
            "marginTop": 15,
            "paddingVertical": 2,
          }
        }
      >
        <ContentPadding
          padding={Object {}}
          style={Object {}}
        >
          <Text
            color="blackColor"
            markdown={false}
            markdownStyle={Object {}}
            style={
              Object {
                "alignSelf": "flex-end",
                "color": "#ffffff",
              }
            }
            type="xSmall"
          >
            Made in partnership with Red Badger
          </Text>
        </ContentPadding>
      </View>
      <Component
        source={1}
        style={
          Object {
            "left": 15,
            "position": "absolute",
          }
        }
      />
    </View>
  </View>
</ScrollView>
`;

exports[`HomeScreen Component renders max 6 events 1`] = `
<ScrollView
  style={
    Object {
      "backgroundColor": "#ffffff",
    }
  }
  testID="home-screen"
>
  <View
    style={
      Object {
        "backgroundColor": "#ffffff",
      }
    }
  >
    <Header
      getImageDetails={[MockFunction]}
      headerBanners={
        Array [
          Object {
            "contentType": "headerBanner",
            "fields": Object {
              "backgroundColour": "#ff0000",
              "heading": "heading",
              "headingLine2": "headingLine2",
              "heroImage": Object {
                "sys": Object {
                  "id": "2re6B7z5h1VJ0y",
                },
              },
              "subHeading": "subHeading",
            },
            "id": "g3QY",
            "locale": "en-GB",
            "revision": 1,
          },
          Object {
            "contentType": "headerBanner",
            "fields": Object {
              "backgroundColour": "#ff0000",
              "heading": "heading",
              "headingLine2": "headingLine2",
              "heroImage": Object {
                "sys": Object {
                  "id": "X4El6Ef26uBA32r",
                },
              },
              "subHeading": "subHeading",
            },
            "id": "G36Nw4N4Qb1HE305M0V",
            "locale": "en-GB",
            "revision": 1,
          },
        ]
      }
      navigation={
        Object {
          "navigate": [MockFunction],
        }
      }
    />
    <ContentPadding
      padding={Object {}}
      style={
        Object {
          "alignSelf": "center",
          "maxWidth": 440,
        }
      }
    >
      <View
        style={
          Object {
            "alignItems": "center",
            "flexDirection": "row",
            "justifyContent": "space-between",
            "marginTop": 12,
          }
        }
      >
        <Text
          color="blackColor"
          markdown={false}
          markdownStyle={Object {}}
          style={
            Object {
              "color": "rgb(45, 47, 127)",
            }
          }
          type="h2"
        >
          Featured events
        </Text>
        <Touchable
          accessibilityComponentType="button"
          accessibilityTraits={
            Array [
              "button",
            ]
          }
          delayPressIn={50}
          onPress={[Function]}
          testID="view-all"
        >
          <TextLink>
            View all
          </TextLink>
        </Touchable>
      </View>
      <View
        style={
          Object {
            "flexDirection": "row",
            "flexWrap": "wrap",
          }
        }
      >
        <View
          key="hG"
          style={
            Array [
              Object {
                "marginBottom": 12,
                "width": "50%",
              },
              Object {
                "paddingRight": 8,
              },
            ]
          }
        >
          <Touchable
            accessibilityComponentType="button"
            accessibilityTraits={
              Array [
                "button",
              ]
            }
            delayPressIn={50}
            onPress={[Function]}
            style={
              Object {
                "backgroundColor": "#ffffff",
                "borderRadius": 3,
                "borderWidth": 0,
                "elevation": 3,
                "flex": 1,
                "justifyContent": "flex-start",
                "shadowColor": "rgba(0, 0, 0, 0.2)",
                "shadowOffset": Object {
                  "height": 1,
                  "width": 0,
                },
                "shadowOpacity": 1,
                "shadowRadius": 3,
              }
            }
            testID="event-tile-0"
          >
            <EventTile
              date="2018-07-07T00:00+00:00"
              eventCategories={
                Array [
                  "Social and Networking",
                  "Talks and Debates",
                ]
              }
              imageReference={
                Object {
                  "sys": Object {
                    "id": "8iB636ntgq3B632hFy6uHIt7kC",
                  },
                }
              }
              name="name"
            />
          </Touchable>
        </View>
        <View
          key="5obj688Cj3vM"
          style={
            Array [
              Object {
                "marginBottom": 12,
                "width": "50%",
              },
              false,
            ]
          }
        >
          <Touchable
            accessibilityComponentType="button"
            accessibilityTraits={
              Array [
                "button",
              ]
            }
            delayPressIn={50}
            onPress={[Function]}
            style={
              Object {
                "backgroundColor": "#ffffff",
                "borderRadius": 3,
                "borderWidth": 0,
                "elevation": 3,
                "flex": 1,
                "justifyContent": "flex-start",
                "shadowColor": "rgba(0, 0, 0, 0.2)",
                "shadowOffset": Object {
                  "height": 1,
                  "width": 0,
                },
                "shadowOpacity": 1,
                "shadowRadius": 3,
              }
            }
            testID="event-tile-1"
          >
            <EventTile
              date="2018-07-07T00:00+00:00"
              eventCategories={
                Array [
                  "Cabaret and Variety",
                  "Health",
                  "Nightlife",
                  "Music",
                  "Talks and Debates",
                ]
              }
              imageReference={
                Object {
                  "sys": Object {
                    "id": "b8Gmbw5l8QQWmULc94kd5U4",
                  },
                }
              }
              name="name"
            />
          </Touchable>
        </View>
        <View
          key="Ii3rT8J7D7oRAsi73e2G"
          style={
            Array [
              Object {
                "marginBottom": 12,
                "width": "50%",
              },
              Object {
                "paddingRight": 8,
              },
            ]
          }
        >
          <Touchable
            accessibilityComponentType="button"
            accessibilityTraits={
              Array [
                "button",
              ]
            }
            delayPressIn={50}
            onPress={[Function]}
            style={
              Object {
                "backgroundColor": "#ffffff",
                "borderRadius": 3,
                "borderWidth": 0,
                "elevation": 3,
                "flex": 1,
                "justifyContent": "flex-start",
                "shadowColor": "rgba(0, 0, 0, 0.2)",
                "shadowOffset": Object {
                  "height": 1,
                  "width": 0,
                },
                "shadowOpacity": 1,
                "shadowRadius": 3,
              }
            }
            testID="event-tile-2"
          >
            <EventTile
              date="2018-07-07T00:00+00:00"
              eventCategories={
                Array [
                  "Talks and Debates",
                  "Sports and Activities",
                ]
              }
              imageReference={
                Object {
                  "sys": Object {
                    "id": "brWIC",
                  },
                }
              }
              name="name"
            />
          </Touchable>
        </View>
        <View
          key="24f3tJ9kLEIsCL0O8y881NG4pjYP2"
          style={
            Array [
              Object {
                "marginBottom": 12,
                "width": "50%",
              },
              false,
            ]
          }
        >
          <Touchable
            accessibilityComponentType="button"
            accessibilityTraits={
              Array [
                "button",
              ]
            }
            delayPressIn={50}
            onPress={[Function]}
            style={
              Object {
                "backgroundColor": "#ffffff",
                "borderRadius": 3,
                "borderWidth": 0,
                "elevation": 3,
                "flex": 1,
                "justifyContent": "flex-start",
                "shadowColor": "rgba(0, 0, 0, 0.2)",
                "shadowOffset": Object {
                  "height": 1,
                  "width": 0,
                },
                "shadowOpacity": 1,
                "shadowRadius": 3,
              }
            }
            testID="event-tile-3"
          >
            <EventTile
              date="2018-07-07T00:00+00:00"
              eventCategories={
                Array [
                  "Social and Networking",
                  "Nightlife",
                  "Music",
                  "Community",
                  "Film and Screenings",
                ]
              }
              imageReference={
                Object {
                  "sys": Object {
                    "id": "H7xkAV37pJQ8Wj6g8wEd",
                  },
                }
              }
              name="name"
            />
          </Touchable>
        </View>
        <View
          key="Lh09pJ3"
          style={
            Array [
              Object {
                "marginBottom": 12,
                "width": "50%",
              },
              Object {
                "paddingRight": 8,
              },
            ]
          }
        >
          <Touchable
            accessibilityComponentType="button"
            accessibilityTraits={
              Array [
                "button",
              ]
            }
            delayPressIn={50}
            onPress={[Function]}
            style={
              Object {
                "backgroundColor": "#ffffff",
                "borderRadius": 3,
                "borderWidth": 0,
                "elevation": 3,
                "flex": 1,
                "justifyContent": "flex-start",
                "shadowColor": "rgba(0, 0, 0, 0.2)",
                "shadowOffset": Object {
                  "height": 1,
                  "width": 0,
                },
                "shadowOpacity": 1,
                "shadowRadius": 3,
              }
            }
            testID="event-tile-4"
          >
            <EventTile
              date="2018-07-07T00:00+00:00"
              eventCategories={
                Array [
                  "Music",
                  "Sports and Activities",
                  "Film and Screenings",
                  "Community",
                  "Health",
                ]
              }
              imageReference={
                Object {
                  "sys": Object {
                    "id": "4z0W7qShu4ms511HGbT",
                  },
                }
              }
              name="name"
            />
          </Touchable>
        </View>
        <View
          key="LWl2GmyPCp6r35lxTSxt5x1lr"
          style={
            Array [
              Object {
                "marginBottom": 12,
                "width": "50%",
              },
              false,
            ]
          }
        >
          <Touchable
            accessibilityComponentType="button"
            accessibilityTraits={
              Array [
                "button",
              ]
            }
            delayPressIn={50}
            onPress={[Function]}
            style={
              Object {
                "backgroundColor": "#ffffff",
                "borderRadius": 3,
                "borderWidth": 0,
                "elevation": 3,
                "flex": 1,
                "justifyContent": "flex-start",
                "shadowColor": "rgba(0, 0, 0, 0.2)",
                "shadowOffset": Object {
                  "height": 1,
                  "width": 0,
                },
                "shadowOpacity": 1,
                "shadowRadius": 3,
              }
            }
            testID="event-tile-5"
          >
            <EventTile
              date="2018-07-07T00:00+00:00"
              eventCategories={
                Array [
                  "Social and Networking",
                ]
              }
              imageReference={
                Object {
                  "sys": Object {
                    "id": "9bKufQ65T7",
                  },
                }
              }
              name="name"
            />
          </Touchable>
        </View>
      </View>
    </ContentPadding>
    <View
      style={
        Object {
          "height": 42,
          "marginBottom": 16,
          "marginTop": 12,
        }
      }
    >
      <View
        style={
          Object {
            "backgroundColor": "#2d2f7f",
            "marginTop": 15,
            "paddingVertical": 2,
          }
        }
      >
        <ContentPadding
          padding={Object {}}
          style={Object {}}
        >
          <Text
            color="blackColor"
            markdown={false}
            markdownStyle={Object {}}
            style={
              Object {
                "alignSelf": "flex-end",
                "color": "#ffffff",
              }
            }
            type="xSmall"
          >
            Made in partnership with Red Badger
          </Text>
        </ContentPadding>
      </View>
      <Component
        source={1}
        style={
          Object {
            "left": 15,
            "position": "absolute",
          }
        }
      />
    </View>
  </View>
</ScrollView>
`;