Using Angular Material's component harnesses
You saw an example of how to use the Material Button harness in Chapter 4, Exploring Angular Components Features. Now, let's explore how to test the theme component using the material test harnesses with a Test as a user strategy.
As you might remember, the theme component lets us select the color and size settings for Angular Academy. The user can do this by selecting a color by going to the Color Input field to obtain the wanted color for the given Header background setting. To simulate this action while testing as a user, we will use a MatInputHarness
with the #headerBackground
selector:
it('should be able to read default header background color theme setting', async () => { const headerBackground: MatInputHarness = await loader.getHarness( MatInputHarness.with({ selector: '#headerBackground...