From 0c9d4f418cc01caa3783fac7aa4ade29913e53b6 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 10 Feb 2024 19:53:37 -0800 Subject: [PATCH 1/2] feat: [closes #443] show age for cows offered for trade (#481) --- src/components/CowCard/Subheader/Subheader.js | 2 +- .../CowCard/Subheader/Subheader.test.js | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/components/CowCard/Subheader/Subheader.js b/src/components/CowCard/Subheader/Subheader.js index 548255161..4827f6937 100644 --- a/src/components/CowCard/Subheader/Subheader.js +++ b/src/components/CowCard/Subheader/Subheader.js @@ -106,7 +106,7 @@ const Subheader = ( return (
- {isCowPurchased && ( + {(isCowPurchased || cowIdOfferedForTrade) && (

{cow.daysOld} {cow.daysOld === 1 ? 'day' : 'days'} old

diff --git a/src/components/CowCard/Subheader/Subheader.test.js b/src/components/CowCard/Subheader/Subheader.test.js index f04dd7639..086796932 100644 --- a/src/components/CowCard/Subheader/Subheader.test.js +++ b/src/components/CowCard/Subheader/Subheader.test.js @@ -100,4 +100,34 @@ describe('Subheader', () => { expect(value).toBeInTheDocument() }) }) + + describe('cow age display', () => { + const ageRegex = /days? old/ + test('displays when purchased', () => { + render() + + const age = screen.queryByText(ageRegex) + expect(age).not.toBeNull() + }) + + test('displays when offered as trade', () => { + render( + + ) + + const age = screen.queryByText(ageRegex) + expect(age).not.toBeNull() + }) + + test('hidden when unpurchased from shop', () => { + render() + + const age = screen.queryByText(ageRegex) + expect(age).toBeNull() + }) + }) }) From b9fa978957a1ccf74358a039f4b5024e451b017e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 11 Feb 2024 03:57:09 +0000 Subject: [PATCH 2/2] 1.18.10 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 077c7a161..d185418ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jeremyckahn/farmhand", - "version": "1.18.9", + "version": "1.18.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@jeremyckahn/farmhand", - "version": "1.18.9", + "version": "1.18.10", "license": "GPL-2.0-or-later", "dependencies": { "@emotion/react": "^11.11.1", diff --git a/package.json b/package.json index 2df4430a1..f2d94003e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@jeremyckahn/farmhand", - "version": "1.18.9", + "version": "1.18.10", "publishConfig": { "access": "public" },