Hey @michaelng-creative - I tried taking a look, hopefully I can help you continue.
First, is your repo up to date with those screen shots? When I first ran your script, I was getting errors:
It says ‘type is ambiguous’ - I don’t see this in your screen shots, so maybe you resolved it. This is due to your join creating multiple ‘type’ columns, so you have to specify which table you want the column from. e.g. change your query to use types.type.
When I first ran the tests, there were three database related tests not passing. I think you just need to adjust the atomic_mass values to pass all those. I would try and get those passing first.
After that, I removed the title your script prints, and the first script test passed. The script should only output exactly what the test asks for. I will make a note to clarify the user stories or make better tests there.
This is probably enough to get you on the right track, but here’s a few more things I see…
Your script needs to allow three different types of input - as the tests suggest, running ./element.sh 1, ./element.sh H, or ./element.sh Hydrogen should all output the information for Hydrogen. You will need to adjust the way you query the database I think for that.
Lastly, I saw one other issue in the database:
^ The type_id for all the elements there doesn’t match the actual type.
Uh oh, you’re right… I think I gotta update my repo (since I did resolve some of those database issues in CodeAlly’s VM when taking the screenshots… Sorry)
Anyway, after removing the line of code that prints the title ~~~Periodic Table~~~ from my script, it passes all four tests… effortlessly!
Thanks Tom! I really appreciate your help; you did a wonderful job