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

[4.4] Cypress test for popular articles in mod_articles_popular #40189

Merged
merged 1 commit into from
Mar 25, 2023

Conversation

sandewt
Copy link
Contributor

@sandewt sandewt commented Mar 25, 2023

Pull Request for Issue # .

Add mod_articles_popular system test.

@sandewt
Copy link
Contributor Author

sandewt commented Mar 25, 2023

Result of the (local) Cypress test in browser

pr_40189

@brianteeman
Copy link
Contributor

Surely thats just testing if the module loads something and not that it loads something popular

@sandewt
Copy link
Contributor Author

sandewt commented Mar 25, 2023

Surely thats just testing if the module loads something and not that it loads something popular

It would indeed be nicer to load, for example, the last five articles with one of them with the title of the test article.
The question is whether that is possible in a simple way.

I've tried that but haven't gotten it done yet.

@laoneo
Copy link
Member

laoneo commented Mar 25, 2023

For now this is ok, we can always add more tests in the future when we get more experience.

@laoneo laoneo merged commit 2adf119 into joomla:4.4-dev Mar 25, 2023
@laoneo laoneo added this to the Joomla! 4.4.0 milestone Mar 25, 2023
@sandewt
Copy link
Contributor Author

sandewt commented Mar 25, 2023

This can be achieved very easily, without the automated test article

pr_40189-2

@sandewt
Copy link
Contributor Author

sandewt commented Mar 25, 2023

@laoneo very easy to change

.then(() => cy.db_createModule({ module: 'mod_articles_popular', params: JSON.stringify({ catid: 2 }) }))
becomes
.then(() => cy.db_createModule({ module: 'mod_articles_popular }))

[EDIT I can make a new pr]

@sandewt
Copy link
Contributor Author

sandewt commented Mar 25, 2023

Note; It would then be nice to use an if statement if there are no articles yet

@laoneo
Copy link
Member

laoneo commented Mar 25, 2023

Tests should not have conditions and you have to always assume the database is empty. So you have to setup tthe database in a way you want to test it.

@sandewt
Copy link
Contributor Author

sandewt commented Mar 25, 2023

Thanks

@sandewt sandewt deleted the patch-8 branch April 26, 2023 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants