Skip to content

Fixes #39443 - replace AuditsPageActions tests with RTL testing and fix bug with audits initialization#11035

Merged
Lukshio merged 1 commit into
theforeman:developfrom
andreilakatos:fixes-39443-audits-page-actions
Jul 1, 2026
Merged

Fixes #39443 - replace AuditsPageActions tests with RTL testing and fix bug with audits initialization#11035
Lukshio merged 1 commit into
theforeman:developfrom
andreilakatos:fixes-39443-audits-page-actions

Conversation

@andreilakatos

Copy link
Copy Markdown
Contributor

Fixes #39443 - replace AuditsPageActions tests with RTL testing

@github-actions github-actions Bot added the UI label Jun 22, 2026
@andreilakatos andreilakatos force-pushed the fixes-39443-audits-page-actions branch from b9c43f9 to f6b54ed Compare June 23, 2026 10:44
@andreilakatos

Copy link
Copy Markdown
Contributor Author

On this PR I noticed an if statement that would not run ever:
image
It was:
!history.action === 'POP' which would translate to either false === 'POP' or true === 'POP'. I fixed that and the integration test for it. This was done 7 years ago though 😬
@glekner Is this what you intended?

@Lukshio Lukshio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some changes below, also update PR title if you want to update .rb tests in this PR or open following new one.

Comment thread test/integration/hostgroup_js_test.rb Outdated

test 'creates a hostgroup with provisioning data' do
os = FactoryBot.create(:ubuntu14_10, :with_associations)
os = as_admin { FactoryBot.create(:ubuntu14_10, :with_associations) }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason to test it as_admin?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's what cursor helped me for the integration test to pass. I'll try to remove to see if it works.

@andreilakatos andreilakatos changed the title Fixes #39443 - replace AuditsPageActions tests with RTL testing Fixes #39443 - replace AuditsPageActions tests with RTL testing and fix bug with audits initialization Jul 1, 2026
@Lukshio

Lukshio commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@andreilakatos Looks good, squash please

@andreilakatos andreilakatos force-pushed the fixes-39443-audits-page-actions branch from 8bb63e5 to 1526e68 Compare July 1, 2026 14:23
@Lukshio

Lukshio commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

CI failure not related, thanks @andreilakatos

@Lukshio Lukshio merged commit d9e86bb into theforeman:develop Jul 1, 2026
63 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants