Update Calendar Tests
Explore how to update calendar tests within an Angular dashboard, verifying event population, default week view, and button states. Learn to use spies for method calls and ensure proper rendering of events using asynchronous testing and DOM queries.
We'll cover the following...
We'll cover the following...
Below is our updated code. Use this to make further changes mentioned in the lesson.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>LetsGetLunch</title> <base href="/"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico"> </head> <body> <app-root></app-root> </body> </html>
Updated dashboard calendar
Let’s update our tests now that our events are populated within the calendar.
- Add two spies for our new
addJSDateandaddEventColorsmethods, chaining them with.callThrough()to allow the implementation to run.
- Now update our initialization test. Leverage our two spies to verify that the functions have been called when a collection of users have been returned.