From 5a8ce7655cb191316965d2c0b04630dfd35651e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Curcio?= Date: Tue, 11 Sep 2018 13:09:49 -0300 Subject: [PATCH] Updated tests --- .../test/__snapshots__/signIn.spec.tsx.snap | 54 ++- .../test/__snapshots__/signUp.spec.tsx.snap | 369 ++++++++++++++---- .../ui/components/Message/Message.spec.tsx | 6 +- .../client/ui/components/Message/Message.tsx | 3 - .../__snapshots__/Message.spec.tsx.snap | 2 +- .../ValidationMessage/ValidationMessage.tsx | 9 +- .../ValidationMessage.spec.tsx.snap | 9 +- 7 files changed, 341 insertions(+), 111 deletions(-) diff --git a/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap b/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap index b4db66fc7..c21b65546 100644 --- a/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap +++ b/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap @@ -34,9 +34,14 @@ exports[`accepts correct password 1`] = ` value="" />
+ This field is required. @@ -175,9 +180,14 @@ exports[`accepts valid email 1`] = ` value="" />
+ This field is required. @@ -280,9 +290,14 @@ exports[`checks for invalid email 1`] = ` value="invalid-email" />
+ Please enter a valid email address. @@ -306,9 +321,14 @@ exports[`checks for invalid email 1`] = ` value="" />
+ This field is required. @@ -526,9 +546,14 @@ exports[`shows error when submitting empty form 1`] = ` value="" />
+ This field is required. @@ -552,9 +577,14 @@ exports[`shows error when submitting empty form 1`] = ` value="" />
+ This field is required. diff --git a/src/core/client/auth/test/__snapshots__/signUp.spec.tsx.snap b/src/core/client/auth/test/__snapshots__/signUp.spec.tsx.snap index e18788d70..88ec82da6 100644 --- a/src/core/client/auth/test/__snapshots__/signUp.spec.tsx.snap +++ b/src/core/client/auth/test/__snapshots__/signUp.spec.tsx.snap @@ -34,9 +34,14 @@ exports[`accepts correct password 1`] = ` value="" />
+ This field is required. @@ -65,9 +70,14 @@ exports[`accepts correct password 1`] = ` value="" />
+ This field is required. @@ -114,9 +124,14 @@ exports[`accepts correct password 1`] = ` value="" />
+ This field is required. @@ -200,9 +215,14 @@ exports[`accepts correct password confirmation 1`] = ` value="" />
+ This field is required. @@ -231,9 +251,14 @@ exports[`accepts correct password confirmation 1`] = ` value="" />
+ This field is required. @@ -262,9 +287,14 @@ exports[`accepts correct password confirmation 1`] = ` value="" />
+ This field is required. @@ -288,9 +318,14 @@ exports[`accepts correct password confirmation 1`] = ` value="testtest" />
+ Passwords do not match. Try again. @@ -397,9 +432,14 @@ exports[`accepts valid email 1`] = ` value="" />
+ This field is required. @@ -428,9 +468,14 @@ exports[`accepts valid email 1`] = ` value="" />
+ This field is required. @@ -454,9 +499,14 @@ exports[`accepts valid email 1`] = ` value="" />
+ This field is required. @@ -540,9 +590,14 @@ exports[`accepts valid username 1`] = ` value="" />
+ This field is required. @@ -594,9 +649,14 @@ exports[`accepts valid username 1`] = ` value="" />
+ This field is required. @@ -620,9 +680,14 @@ exports[`accepts valid username 1`] = ` value="" />
+ This field is required. @@ -706,9 +771,14 @@ exports[`checks for invalid characters in username 1`] = ` value="" />
+ This field is required. @@ -737,9 +807,14 @@ exports[`checks for invalid characters in username 1`] = ` value="$%$§$%$§%" />
+ Invalid characters. Try again. @@ -768,9 +843,14 @@ exports[`checks for invalid characters in username 1`] = ` value="" />
+ This field is required. @@ -794,9 +874,14 @@ exports[`checks for invalid characters in username 1`] = ` value="" />
+ This field is required. @@ -880,9 +965,14 @@ exports[`checks for invalid email 1`] = ` value="invalid-email" />
+ Please enter a valid email address. @@ -911,9 +1001,14 @@ exports[`checks for invalid email 1`] = ` value="" />
+ This field is required. @@ -942,9 +1037,14 @@ exports[`checks for invalid email 1`] = ` value="" />
+ This field is required. @@ -968,9 +1068,14 @@ exports[`checks for invalid email 1`] = ` value="" />
+ This field is required. @@ -1054,9 +1159,14 @@ exports[`checks for too long username 1`] = ` value="" />
+ This field is required. @@ -1085,9 +1195,14 @@ exports[`checks for too long username 1`] = ` value="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" />
+ Usernames cannot be longer than ⁨20⁩ characters. @@ -1116,9 +1231,14 @@ exports[`checks for too long username 1`] = ` value="" />
+ This field is required. @@ -1142,9 +1262,14 @@ exports[`checks for too long username 1`] = ` value="" />
+ This field is required. @@ -1228,9 +1353,14 @@ exports[`checks for too short password 1`] = ` value="" />
+ This field is required. @@ -1259,9 +1389,14 @@ exports[`checks for too short password 1`] = ` value="" />
+ This field is required. @@ -1290,9 +1425,14 @@ exports[`checks for too short password 1`] = ` value="pass" />
+ Password must contain at least ⁨8⁩ characters. @@ -1316,9 +1456,14 @@ exports[`checks for too short password 1`] = ` value="" />
+ This field is required. @@ -1402,9 +1547,14 @@ exports[`checks for too short username 1`] = ` value="" />
+ This field is required. @@ -1433,9 +1583,14 @@ exports[`checks for too short username 1`] = ` value="u" />
+ Username must contain at least ⁨3⁩ characters. @@ -1464,9 +1619,14 @@ exports[`checks for too short username 1`] = ` value="" />
+ This field is required. @@ -1490,9 +1650,14 @@ exports[`checks for too short username 1`] = ` value="" />
+ This field is required. @@ -1576,9 +1741,14 @@ exports[`checks for wrong password confirmation 1`] = ` value="" />
+ This field is required. @@ -1607,9 +1777,14 @@ exports[`checks for wrong password confirmation 1`] = ` value="" />
+ This field is required. @@ -1638,9 +1813,14 @@ exports[`checks for wrong password confirmation 1`] = ` value="" />
+ This field is required. @@ -1664,9 +1844,14 @@ exports[`checks for wrong password confirmation 1`] = ` value="not-matching" />
+ Passwords do not match. Try again. @@ -1892,9 +2077,14 @@ exports[`shows error when submitting empty form 1`] = ` value="" />
+ This field is required. @@ -1923,9 +2113,14 @@ exports[`shows error when submitting empty form 1`] = ` value="" />
+ This field is required. @@ -1954,9 +2149,14 @@ exports[`shows error when submitting empty form 1`] = ` value="" />
+ This field is required. @@ -1980,9 +2180,14 @@ exports[`shows error when submitting empty form 1`] = ` value="" />
+ This field is required. diff --git a/src/core/client/ui/components/Message/Message.spec.tsx b/src/core/client/ui/components/Message/Message.spec.tsx index 6f7bfc8cc..ac69cea85 100644 --- a/src/core/client/ui/components/Message/Message.spec.tsx +++ b/src/core/client/ui/components/Message/Message.spec.tsx @@ -16,12 +16,8 @@ it("renders correctly", () => { }); it("renders icon", () => { - const props: PropTypesOf = { - className: "custom", - }; - const renderer = TestRenderer.create( - + alertAlert Message ); diff --git a/src/core/client/ui/components/Message/Message.tsx b/src/core/client/ui/components/Message/Message.tsx index c3f4ea2e8..7547d8442 100644 --- a/src/core/client/ui/components/Message/Message.tsx +++ b/src/core/client/ui/components/Message/Message.tsx @@ -1,9 +1,6 @@ import cn from "classnames"; import React, { ReactNode, StatelessComponent } from "react"; - import { withStyles } from "talk-ui/hocs"; - -import Icon from "../Icon"; import * as styles from "./Message.css"; export interface MessageProps { diff --git a/src/core/client/ui/components/Message/__snapshots__/Message.spec.tsx.snap b/src/core/client/ui/components/Message/__snapshots__/Message.spec.tsx.snap index ae81503dc..38381f0c6 100644 --- a/src/core/client/ui/components/Message/__snapshots__/Message.spec.tsx.snap +++ b/src/core/client/ui/components/Message/__snapshots__/Message.spec.tsx.snap @@ -10,7 +10,7 @@ exports[`renders correctly 1`] = ` exports[`renders icon 1`] = `