From c9729d5520a8c2ba32d92edaf517ef184d9d3294 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Thu, 19 Apr 2018 16:53:50 -0400 Subject: Cart Count Tests --- frontend/README.md | 7 ++++ frontend/__tests__/CartCount.test.js | 2 +- .../__tests__/__snapshots__/CartCount.test.js.snap | 44 ++++++++++++---------- 3 files changed, 32 insertions(+), 21 deletions(-) (limited to 'frontend') diff --git a/frontend/README.md b/frontend/README.md index 8bd3242..6ab9632 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -34,6 +34,13 @@ Keep your brie and bevies chilly. Heavy-duty insulation ensures cold temperature +Test Order: + +FormatMoney +Cart Count + + + diff --git a/frontend/__tests__/CartCount.test.js b/frontend/__tests__/CartCount.test.js index f3c4978..6786a86 100644 --- a/frontend/__tests__/CartCount.test.js +++ b/frontend/__tests__/CartCount.test.js @@ -1,7 +1,7 @@ import React from 'react'; import { shallow, mount } from 'enzyme'; import toJSON from 'enzyme-to-json'; -import { CartCount } from '../components/CartCount'; +import CartCount from '../components/CartCount'; describe('', () => { it('renders okay', () => { diff --git a/frontend/__tests__/__snapshots__/CartCount.test.js.snap b/frontend/__tests__/__snapshots__/CartCount.test.js.snap index ddb6710..7c647f4 100644 --- a/frontend/__tests__/__snapshots__/CartCount.test.js.snap +++ b/frontend/__tests__/__snapshots__/CartCount.test.js.snap @@ -12,10 +12,11 @@ exports[` matches snapshot 1`] = ` key="10" timeout={ Object { - "enter": 2000, - "exit": 2000, + "enter": 400, + "exit": 400, } } + unmountOnExit={true} > 10 @@ -46,10 +47,11 @@ exports[` updates via props 1`] = ` onExited={[Function]} timeout={ Object { - "enter": 2000, - "exit": 2000, + "enter": 400, + "exit": 400, } } + unmountOnExit={true} > updates via props 1`] = ` onExiting={[Function]} timeout={ Object { - "enter": 2000, - "exit": 2000, + "enter": 400, + "exit": 400, } } - unmountOnExit={false} + unmountOnExit={true} >
50
@@ -111,10 +113,11 @@ exports[` updates via props 2`] = ` onExited={[Function]} timeout={ Object { - "enter": 2000, - "exit": 2000, + "enter": 400, + "exit": 400, } } + unmountOnExit={true} > updates via props 2`] = ` onExiting={[Function]} timeout={ Object { - "enter": 2000, - "exit": 2000, + "enter": 400, + "exit": 400, } } - unmountOnExit={false} + unmountOnExit={true} >
10
@@ -156,10 +159,11 @@ exports[` updates via props 2`] = ` onExited={[Function]} timeout={ Object { - "enter": 2000, - "exit": 2000, + "enter": 400, + "exit": 400, } } + unmountOnExit={true} > updates via props 2`] = ` onExiting={[Function]} timeout={ Object { - "enter": 2000, - "exit": 2000, + "enter": 400, + "exit": 400, } } - unmountOnExit={false} + unmountOnExit={true} >
50
-- cgit v1.3