Skip to content

Commit

Permalink
added a change in permalink settings in archive tests for the correct…
Browse files Browse the repository at this point in the history
… operation of hooks for deleting posts and pictures
  • Loading branch information
Fellan-91 committed Aug 21, 2024
1 parent 22e94a7 commit 826695b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/e2e/specs/archive.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,18 @@ test.describe('archive pages', () => {

// check Archive Category filter
expect(receivedCategories).toEqual(expectedArchiveCategoryDefault);

/**
* Set Post Name Permalink Settings.
* Without this stupid change, hooks for deleting posts and images stop working.
* This happens due to the fact that the removal methods use a link to access the API.
* For example this type: wp-json/wp/v2/media
* This link will not be available. It stops working if the permalink settings are set to Plain.
* In this case, when calling the method, the request contains a 404 error.
*/
await admin.visitAdminPage('options-permalink.php');
await page.getByLabel('Post name').check();
await page.getByRole('button', { name: 'Save Changes' }).click();
});

test('check archive page with default pagination and category filter (post name permalinks)', async ({
Expand Down

0 comments on commit 826695b

Please sign in to comment.