Skip to content

Instantly share code, notes, and snippets.

@frogermcs
Created November 29, 2017 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frogermcs/d45b0094c9d2b4f1e0d39c2c0b53718b to your computer and use it in GitHub Desktop.
Save frogermcs/d45b0094c9d2b4f1e0d39c2c0b53718b to your computer and use it in GitHub Desktop.
> water-log@0.2.1 test ...
> mocha --reporter spec
Conversation
actionWelcomeUser
✓ Should create new anonymous user
✓ Should greet new user with audio when screen isnt available
✓ Should greet new user with response and suggestion chips when screen is available
✓ Should greet existing user with name if exists
✓ Should greet existing user with general message if name doesnt exists
actionGetLoggedWater
✓ Should tell about logged water for given user
actionLogWater
✓ Should save given amount of water and response with saved value
actionUpdateSettings
✓ Should ask for user name permission
actionUserData
✓ Should finish with permission denied when permission isnt granted
✓ Should finish with unexpected error when permission granted but empty data
✓ Should ask for precise location permission when permission granted, name exists but location doesnt
✓ Should save user name when permission granted and name exists
✓ Should save user timezone and finish when permission granted, name exists and location exists
getFactForDrinkingWater
✓ Should response with audio text when screen isnt available
✓ Should response with rich card when screen is available
FactsRepository
getRandomWaterFact
✓ Returned water fact should keep consistent interface
getWaterFactAudioTextResponse
✓ Should return audio text from water fact
getWaterFactRichResponse
✓ Should return rich card response from water fact
Cloud Functions
waterLog
TimeManager
getPlatformTime
✓ Should return platform time
getTimeZoneFromCoordinates
✓ Should convert coordinates to timezone
saveAssistantUserTimezone
✓ Should save assistant user timezone into DB
getAssistantUserTimeData
✓ Should return local user time if exists
getTodayStartTimestampForAssistantUser
✓ Should return date for start of the day for user timezone if exists
✓ Should return start of the day date for platform when user timezone doesnt exist
UserManager
isFirstUsage
✓ Should return first usage when user doesnt exist in DB
✓ Shouldnt return first usage when user exists in DB
loadAssistantUser
✓ Shouldnt load expected user from DB
saveAssistantUser
✓ Should save assistant user into DB
saveAssistantUserName
✓ Should save assistant user name into DB
WaterLog
saveLoggedWater
✓ Should save logged mililiters of water
✓ Should save logged liters of water
getLoggedWaterForUser
✓ Should load logged water for given user and present data from recent day
33 passing (88ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment