Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Permalink Structure command #17

Merged
merged 3 commits into from
Mar 23, 2022
Merged

Conversation

cadic
Copy link
Contributor

@cadic cadic commented Mar 22, 2022

Description of the Change

Adds setPermalinkStructure command

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Credits

Props @

@cadic cadic requested a review from dinhtungdu March 22, 2022 15:09
@cadic cadic self-assigned this Mar 22, 2022
Comment on lines +14 to +16
if ('' !== type) {
cy.get('#permalink_structure').click().type(type);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cadic Should we check for this earlier? If users pass the empty type, we do nothing.

Or if the type is required, let's remove the default value!

Setting the default to /%postname%/ is another good direction IMO.

Copy link
Contributor Author

@cadic cadic Mar 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty string is for "Plain" structure. Setting /%postname%/ as default will break the logic, because Plain is default in WordPress core. I will remove the default value.

The "clear before type" workaround is required because Cypress doesn't allow to type empty string.

@cadic cadic requested a review from dinhtungdu March 23, 2022 12:52
Copy link
Contributor

@dinhtungdu dinhtungdu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cadic cadic merged commit 330d8f2 into trunk Mar 23, 2022
@cadic cadic deleted the command/set-permalink-structure branch March 23, 2022 14:14
github-actions bot pushed a commit that referenced this pull request Mar 23, 2022
…nk-structure

Set Permalink Structure command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants