

Sec-CH-UA-WoW64 is used to detect whether or not a user agent binary is running in 32-bit mode on 64-bit Windows. Sec-CH-UA-Bitness represents the bitness of the architecture of the platform on which a given user agent is executing.

Sec-CH-UA-Arch represents the architecture of the platform on which a given user agent is executing. Sec-CH-UA-Platform-Version represents the platform version on which a given user agent is executing. Sec-CH-UA-Platform represents the platform on which a given user agent is executing. Sec-CH-UA-Full-Version-List represents the full version for each brand in its brands list. Sec-CH-UA-Full-Version represents the user agent’s full version (deprecated in favor of Sec-CH-UA-Full-Version-List). Sec-CH-UA represents a user agent's branding and version. HTTP Headers received by the Server upon subsequent requestĪ limited number of Client Hints are available through the JavaScript, no HTTP headers are required here: The server has asked the client to send the above list of headers, and if your browser supports this feature, it should send those Client Hints headers to the server the following requests. To be even more clear, when the flush statement is executed, it sends the mockBookArray data through the stream, the subscribe block resolves and our assertion then takes place.Īt this point, if you run the test, you should get a passing checkmark.Sec-ch-ua,ua,sec-ch-ua-platformua-platform,sec-ch-ua-mobile,ua-mobile,sec-ch-ua-full-version,ua-full-version,sec-ch-ua-full-version-list,sec-ch-ua-platform-version,ua-platform-version,sec-ch-ua-arch,ua-arch,sec-ch-ua-bitness,ua-bitness,sec-ch-ua-wow64,sec-ch-ua-model,ua-model,sec-ch-lang,lang,sec-ch-save-data,save-data,sec-ch-width,width,sec-ch-viewport-width,viewport-width,sec-ch-viewport-height,viewport-height,sec-ch-dpr,dpr,sec-ch-device-memory,device-memory,sec-ch-rtt,rtt,sec-ch-downlink,downlink,sec-ch-ect,ect,sec-ch-prefers-color-scheme,sec-ch-prefers-reduced-motion,sec-ch-prefers-reduced-transparency,sec-ch-prefers-contrast,sec-ch-forced-colors

However, because we must subscribe to the getAllBooks function, we flush the data after we're listening for that Observable to emit the value. At first glance, this sort of seems to go against the normal testing pattern where you'd specify the data to be returned before the assertion statement. We also use the HttpTestingController to flush (send) data through the stream.We set up and utilize the HttpTestingController for multiple reasons, but here we're using it to specify the URL that we expect the Service function to hit, as well as the request method to be used.You may be thinking that this looks funny why do we need to subscribe to the getAllBooks function? The function returns an Observable, so the only way to check the data that is being returned is to subscribe to the Observable and make the assertion inside. This satisfies the Assert step in the Arrange-Act-Assert pattern. I make sure the data coming back from the function is an array of Books, which I've mocked out and brought into this test file.This is part of the Act step in the Arrange-Act-Assert pattern. I call the code under test - the getAllBooks function.This may look like a lot and be confusing, so let me break it down.
