Skip to content

Commit 0d5e852

Browse files
committed
fix: mock root request instead
1 parent c2ba56a commit 0d5e852

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

tests/e2e/tabs/tools/install-core-fonts-field.test.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ test( 'should return download core fonts successful response', async ( t ) => {
3636
.ok();
3737
} );
3838

39-
const mockFailure = RequestMock()
40-
.onRequestTo( `${ baseURL }/wp-admin/admin-ajax.php` )
41-
.respond( { message: 'Something went wrong', ok: false }, 401, {
39+
const mockGithubError = RequestMock()
40+
.onRequestTo(
41+
`${ baseURL }/wp-content/plugins/gravity-pdf/build/payload/core-fonts.json`
42+
)
43+
.respond( { ok: false }, 500, {
4244
'Access-Control-Allow-Origin': '*',
4345
} );
4446

4547
fixture`Tools tab - Install core fonts field test failure`.requestHooks(
46-
mockFailure
48+
mockGithubError
4749
);
4850

4951
test( 'should return download core fonts error/failed response', async ( t ) => {
@@ -53,9 +55,5 @@ test( 'should return download core fonts error/failed response', async ( t ) =>
5355
await t.click( run.downloadCoreFontsButton );
5456

5557
// Assertions
56-
await t
57-
.expect( run.downloadFailed.exists )
58-
.ok()
59-
.expect( run.retryDownload.exists )
60-
.ok();
58+
await t.expect( run.downloadFailed.exists ).ok();
6159
} );

0 commit comments

Comments
 (0)