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
Refs #31459 - remove snapshot testing in the job wizard #607
Refs #31459 - remove snapshot testing in the job wizard #607
Conversation
a938db4
to
da68c9a
Compare
missing the categories will remove the snapshots there as well |
45e27c6
to
038a5f5
Compare
Moved some code into test setups as we discussed @LaViro |
038a5f5
to
b2201e2
Compare
Snapshots are failing xD :) |
At least the snapshots make it easier for me to find them and delete them 😈 |
b2201e2
to
fec5043
Compare
key={name} | ||
isRequired={required} | ||
label={name} | ||
fieldId={name} | ||
options={options} | ||
labelText={labelText} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
labelText is not a real prop
7518a8b
to
8078dee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you separate the Select field fix in separate PR or at least commit pls?
Also sidenote: why do we have SelectField here, when there is most certainly a SelectField in Foreman core (it's quite new, so that would be my guess, but it would be worth considering using it), I'll not block the PR on that tho, so up to you :)
8078dee
to
fa65abd
Compare
Separated into 2 commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me,
just a couple of inline comments
jest.spyOn(selectors, 'selectJobCategoriesStatus'); | ||
const store = testSetup(selectors, api); | ||
|
||
selectors.selectJobTemplate.mockImplementation(() => {}); | ||
jest.spyOn(selectors, 'selectEffectiveUser'); | ||
jest.spyOn(selectors, 'selectTemplateInputs'); | ||
jest.spyOn(selectors, 'selectAdvancedTemplateInputs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should these selectors move to the fixtures file as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those are leftovers so I removed them now :)
jest.spyOn(selectors, 'selectEffectiveUser'); | ||
jest.spyOn(selectors, 'selectTemplateInputs'); | ||
jest.spyOn(selectors, 'selectAdvancedTemplateInputs'); | ||
|
||
selectors.selectEffectiveUser.mockImplementation( | ||
() => jobTemplate.effective_user | ||
); | ||
selectors.selectTemplateInputs.mockImplementation( | ||
() => jobTemplate.template_inputs | ||
); | ||
|
||
selectors.selectAdvancedTemplateInputs.mockImplementation( | ||
() => jobTemplate.advanced_template_inputs | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should also move to fixtures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think they should as they are only relevant to the advanced step
</Form> | ||
</AdvancedFields> | ||
</Provider> | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goodbye 422 lines 🥇
jest.spyOn(selectors, 'selectJobTemplate'); | ||
jest.spyOn(selectors, 'selectJobTemplates'); | ||
jest.spyOn(selectors, 'selectJobCategories'); | ||
jest.spyOn(selectors, 'selectCategoryError'); | ||
jest.spyOn(selectors, 'selectAllTemplatesError'); | ||
jest.spyOn(selectors, 'selectTemplateError'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left only select___Error
as they are the only relevant ones for the tst
@@ -27,6 +27,7 @@ exports[`TargetingHostsPage renders 1`] = ` | |||
"controller": "hosts", | |||
} | |||
} | |||
onChange={[Function]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another snapshot appeared 😮
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a searchbar mock ( instead of the foreman one) that is just <input onchange={onchange}>
so it affected other components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MariaAga !
Moved the advanced step test to the advanced step folder and removed the job wizard snapshot test.