-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
164 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
import { render } from "@testing-library/react"; | ||
import { expect, test } from "vitest"; | ||
import { mockBeer } from "../mocks"; | ||
import { BeerInfo } from "../modules/BeerDetails/BeerInfo"; | ||
import { render } from '@testing-library/react'; | ||
import { expect, test } from 'vitest'; | ||
import { mockBeer } from '../mocks'; | ||
import { BeerInfo } from '../modules/BeerDetails/BeerInfo'; | ||
|
||
test('vitest environment works', () => { | ||
expect(2).toEqual(2) | ||
}) | ||
|
||
test('beer description renders', async () => { | ||
const beerDetails = mockBeer | ||
if (! beerDetails){ | ||
return | ||
} | ||
const beerInfo = render(<BeerInfo beerDetails={beerDetails}/>) | ||
const beerDescription = await beerInfo.findByTestId("beer-description") | ||
expect(beerDescription).toBeDefined() | ||
}) | ||
|
||
|
||
test('vitest environment works', () => { | ||
expect(2).toEqual(2); | ||
}); | ||
|
||
test('beer description renders', async () => { | ||
const beerDetails = mockBeer; | ||
if (!beerDetails) { | ||
return; | ||
} | ||
const beerInfo = render(<BeerInfo beerDetails={beerDetails} />); | ||
const beerDescription = await beerInfo.findByTestId('beer-description'); | ||
expect(beerDescription).toBeDefined(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,116 @@ | ||
export const mockBeer = { | ||
"id": 2, | ||
"name": "Trashy Blonde", | ||
"tagline": "You Know You Shouldn't", | ||
"first_brewed": "04/2008", | ||
"description": "A titillating, neurotic, peroxide punk of a Pale Ale. Combining attitude, style, substance, and a little bit of low self esteem for good measure; what would your mother say? The seductive lure of the sassy passion fruit hop proves too much to resist. All that is even before we get onto the fact that there are no additives, preservatives, pasteurization or strings attached. All wrapped up with the customary BrewDog bite and imaginative twist.", | ||
"imageUrl": "https://images.punkapi.com/v2/2.png", | ||
"abv": 4.1, | ||
"ibu": 41.5, | ||
"target_fg": 1010, | ||
"target_og": 1041.7, | ||
"ebc": 15, | ||
"srm": 15, | ||
"ph": 4.4, | ||
"attenuation_level": 76, | ||
"volume": { | ||
"value": 20, | ||
"unit": "litres" | ||
}, | ||
"boil_volume": { | ||
"value": 25, | ||
"unit": "litres" | ||
}, | ||
"method": { | ||
"mash_temp": [ | ||
{ | ||
"temp": { | ||
"value": 69, | ||
"unit": "celsius" | ||
}, | ||
"duration": null | ||
} | ||
], | ||
"fermentation": { | ||
"temp": { | ||
"value": 18, | ||
"unit": "celsius" | ||
} | ||
}, | ||
"twist": null | ||
}, | ||
"ingredients": { | ||
"malt": [ | ||
{ | ||
"name": "Maris Otter Extra Pale", | ||
"amount": { | ||
"value": 3.25, | ||
"unit": "kilograms" | ||
} | ||
}, | ||
{ | ||
"name": "Caramalt", | ||
"amount": { | ||
"value": 0.2, | ||
"unit": "kilograms" | ||
} | ||
}, | ||
{ | ||
"name": "Munich", | ||
"amount": { | ||
"value": 0.4, | ||
"unit": "kilograms" | ||
} | ||
} | ||
], | ||
"hops": [ | ||
{ | ||
"name": "Amarillo", | ||
"amount": { | ||
"value": 13.8, | ||
"unit": "grams" | ||
}, | ||
"add": "start", | ||
"attribute": "bitter" | ||
}, | ||
{ | ||
"name": "Simcoe", | ||
"amount": { | ||
"value": 13.8, | ||
"unit": "grams" | ||
}, | ||
"add": "start", | ||
"attribute": "bitter" | ||
}, | ||
{ | ||
"name": "Amarillo", | ||
"amount": { | ||
"value": 26.3, | ||
"unit": "grams" | ||
}, | ||
"add": "end", | ||
"attribute": "flavour" | ||
}, | ||
{ | ||
"name": "Motueka", | ||
"amount": { | ||
"value": 18.8, | ||
"unit": "grams" | ||
}, | ||
"add": "end", | ||
"attribute": "flavour" | ||
} | ||
], | ||
"yeast": "Wyeast 1056 - American Ale™" | ||
}, | ||
"food_pairing": [ | ||
"Fresh crab with lemon", | ||
"Garlic butter dipping sauce", | ||
"Goats cheese salad", | ||
"Creamy lemon bar doused in powdered sugar" | ||
], | ||
"brewers_tips": "Be careful not to collect too much wort from the mash. Once the sugars are all washed out there are some very unpleasant grainy tasting compounds that can be extracted into the wort.", | ||
"contributed_by": "Sam Mason <samjbmason>" | ||
} | ||
id: 2, | ||
name: 'Trashy Blonde', | ||
tagline: "You Know You Shouldn't", | ||
first_brewed: '04/2008', | ||
description: | ||
'A titillating, neurotic, peroxide punk of a Pale Ale. Combining attitude, style, substance, and a little bit of low self esteem for good measure; what would your mother say? The seductive lure of the sassy passion fruit hop proves too much to resist. All that is even before we get onto the fact that there are no additives, preservatives, pasteurization or strings attached. All wrapped up with the customary BrewDog bite and imaginative twist.', | ||
imageUrl: 'https://images.punkapi.com/v2/2.png', | ||
abv: 4.1, | ||
ibu: 41.5, | ||
target_fg: 1010, | ||
target_og: 1041.7, | ||
ebc: 15, | ||
srm: 15, | ||
ph: 4.4, | ||
attenuation_level: 76, | ||
volume: { | ||
value: 20, | ||
unit: 'litres', | ||
}, | ||
boil_volume: { | ||
value: 25, | ||
unit: 'litres', | ||
}, | ||
method: { | ||
mash_temp: [ | ||
{ | ||
temp: { | ||
value: 69, | ||
unit: 'celsius', | ||
}, | ||
duration: null, | ||
}, | ||
], | ||
fermentation: { | ||
temp: { | ||
value: 18, | ||
unit: 'celsius', | ||
}, | ||
}, | ||
twist: null, | ||
}, | ||
ingredients: { | ||
malt: [ | ||
{ | ||
name: 'Maris Otter Extra Pale', | ||
amount: { | ||
value: 3.25, | ||
unit: 'kilograms', | ||
}, | ||
}, | ||
{ | ||
name: 'Caramalt', | ||
amount: { | ||
value: 0.2, | ||
unit: 'kilograms', | ||
}, | ||
}, | ||
{ | ||
name: 'Munich', | ||
amount: { | ||
value: 0.4, | ||
unit: 'kilograms', | ||
}, | ||
}, | ||
], | ||
hops: [ | ||
{ | ||
name: 'Amarillo', | ||
amount: { | ||
value: 13.8, | ||
unit: 'grams', | ||
}, | ||
add: 'start', | ||
attribute: 'bitter', | ||
}, | ||
{ | ||
name: 'Simcoe', | ||
amount: { | ||
value: 13.8, | ||
unit: 'grams', | ||
}, | ||
add: 'start', | ||
attribute: 'bitter', | ||
}, | ||
{ | ||
name: 'Amarillo', | ||
amount: { | ||
value: 26.3, | ||
unit: 'grams', | ||
}, | ||
add: 'end', | ||
attribute: 'flavour', | ||
}, | ||
{ | ||
name: 'Motueka', | ||
amount: { | ||
value: 18.8, | ||
unit: 'grams', | ||
}, | ||
add: 'end', | ||
attribute: 'flavour', | ||
}, | ||
], | ||
yeast: 'Wyeast 1056 - American Ale™', | ||
}, | ||
food_pairing: [ | ||
'Fresh crab with lemon', | ||
'Garlic butter dipping sauce', | ||
'Goats cheese salad', | ||
'Creamy lemon bar doused in powdered sugar', | ||
], | ||
brewers_tips: | ||
'Be careful not to collect too much wort from the mash. Once the sugars are all washed out there are some very unpleasant grainy tasting compounds that can be extracted into the wort.', | ||
contributed_by: 'Sam Mason <samjbmason>', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./beer"; | ||
export * from './beer'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters