Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add abv% for cocktails on cocktail page #36

Open
mikeyhogarth opened this issue Jun 8, 2019 · 2 comments
Open

Add abv% for cocktails on cocktail page #36

mikeyhogarth opened this issue Jun 8, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mikeyhogarth
Copy link
Owner

mikeyhogarth commented Jun 8, 2019

We have the abv% for each ingredient - from this it should be possible to calculated the overall abv% for the cocktail and display it. We would need;

  • A function that takes a set of ingredients and returns a decimal showing total percentage
  • A call to that function in the fetchCocktails function that adds it (in much the same way we're adding the slug there)
  • Display it on the views (maybe in the existing subheaders)

This might be a good resource for writing test cases:
https://www.artofdrink.com/blog/alcohol-percentages-of-cocktails?fbclid=IwAR0kWRiv5P8_Yv0iYIcqpM43mHXzzeJ1_fdn_rwqxGoTK9xbhxBe77UVomU

This needs to be calculated rather than hard-coded against each cocktail so that if we ever add new cocktails it'll just all automatically happen.

@mikeyhogarth mikeyhogarth added enhancement New feature or request good first issue Good for newcomers labels Jun 8, 2019
@TommyJackson85
Copy link

I will take up this task @mikeyhogarth

@mikeyhogarth
Copy link
Owner Author

mikeyhogarth commented Dec 4, 2019

I will take up this task @mikeyhogarth

Be my guest dude 😀 I would probably start with the tests on this one (that article I linked to has some calculations, they could basically form the tests).

Absolutely no hurry - I've assigned the issue to you, let me know if you change your mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants