Skip to content

Tests for org-links outside of org-mode - #512

Merged
rswgnu merged 2 commits into
masterfrom
test-for-org-links-outside-of-org-mode
Apr 10, 2024
Merged

rswgnu merged 2 commits into
masterfrom
test-for-org-links-outside-of-org-mode

Conversation

@matsl

@matsl matsl commented Apr 8, 2024

Copy link
Copy Markdown
Collaborator

What

Tests for org-links outside of org-mode.

Why

There was a bug here where hsys-org-enable-smart-keys would
interfere with the org-links which is should not. It is only
applicable within org-mode. A fix for that has already been pushed.

@matsl
matsl force-pushed the test-for-org-links-outside-of-org-mode branch from 0ed47bb to 3f7adcc Compare April 8, 2024 14:41
@matsl
matsl requested a review from rswgnu April 8, 2024 14:42
@matsl
matsl force-pushed the test-for-org-links-outside-of-org-mode branch from 3f7adcc to f62a646 Compare April 8, 2024 15:06

@rswgnu rswgnu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Look at the values of hsys-org-enable-smart-keys, need to test those to ensure nothing gets written that is conditionalized on that and stops these links from working.

@matsl

matsl commented Apr 8, 2024

Copy link
Copy Markdown
Collaborator Author

Look at the values of hsys-org-enable-smart-keys, need to test those to ensure nothing gets written that is conditionalized on that and stops these links from working.

Are you saying that we need to run the test with all four values (unset buttons t nil)?

@rswgnu

rswgnu commented Apr 8, 2024 via email

Copy link
Copy Markdown
Owner

@matsl

matsl commented Apr 8, 2024

Copy link
Copy Markdown
Collaborator Author

Yes.

Easy to fix. Update tomorrow.

@matsl

matsl commented Apr 9, 2024

Copy link
Copy Markdown
Collaborator Author

Easy to fix. Update tomorrow.

Looping over the possible values, repeating the test. PTAL.

@matsl
matsl requested a review from rswgnu April 9, 2024 07:55

@rswgnu rswgnu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

How are you trsting that the action key actually opens the link properly if that is the function you are mocking?

you are not trying to test that the variable is set right but to see if setting it affects recognition and execution of the button, i.e. runs the right action.

@matsl

matsl commented Apr 9, 2024

Copy link
Copy Markdown
Collaborator Author

How are you trsting that the action key actually opens the link properly if that is the function you are mocking?

you are not trying to test that the variable is set right but to see if setting it affects recognition and execution of the button, i.e. runs the right action.

These are unit test that verifies org-open-at-point-global is called as a result of using the action-key (which it was not before your fix.) If the mocked function is not called the test fails. It does not attempt to verify that org-open-at-point-global does the right thing since that is an org function.

@matsl
matsl requested a review from rswgnu April 9, 2024 21:23
@rswgnu

rswgnu commented Apr 10, 2024 via email

Copy link
Copy Markdown
Owner

@rswgnu
rswgnu merged commit a45b16f into master Apr 10, 2024
@matsl
matsl deleted the test-for-org-links-outside-of-org-mode branch April 10, 2024 06:41
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