Add tests for the addition of cached data in the dashboard frontend package#22216
Add tests for the addition of cached data in the dashboard frontend package#22216igorschoester merged 10 commits intotrunkfrom
Conversation
Pull Request Test Coverage Report for Build 91b9a4994deeba5f197c52928f328466f14ced00Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Some branches are not covered.
I can recommend running coverage and checking out the report for details.
| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
|---|---|---|---|---|---|
| cache.js | 90 | 66.67 | 100 | 90 | 59,69,200-208 |
Code coverage report for src_services_cache.js (5_6_2025 11:07:40 AM).html.zip
There was a problem hiding this comment.
Brought branch coverage to 80% with this commit. I've tried to mock the storage API functions, to increase it even more to no avail.
There was a problem hiding this comment.
Here is an example of getting to test the exception for an error when the storage is exceeded:
it( "should return the storage also when quota exceeded", () => {
global.FakeStorage = {
setItem: jest.fn().mockImplementation( () => {
throw new DOMException( "code 22", "QuotaExceededError" );
} ),
removeItem: jest.fn(),
length: 1,
};
setStorageOrder( [ "FakeStorage" ] );
try {
expect( getStorage() ).toEqual( global.FakeStorage );
expect( global.FakeStorage.setItem ).toHaveBeenCalled();
} finally {
// Clean up the fake storage.
delete global.FakeStorage;
}
} );Not sure how far you actually want/need to go. But if it is because you didn't know how, this should help.
5bc6e36 to
e4447a3
Compare
18a4890 to
0ae3d8c
Compare
79277b0 to
f79718c
Compare
Context
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Relevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
UI changes
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.Documentation
Quality assurance
Innovation
innovationlabel.Fixes https://github.com/Yoast/reserved-tasks/issues/515