Commit c0f4f041 authored by Alexander Turinske's avatar Alexander Turinske Committed by Michał Zając

Update tests for footer component

- updated jest tests to test props passed into component
- update vulnerability_helper test
parent 537d84fb
......@@ -62,6 +62,7 @@ describe('Vulnerability Footer', () => {
it('does show solution card when there is one', () => {
createWrapper({ ...minimumProps, solutionInfo: solutionInfoProp });
expect(wrapper.contains(SolutionCard)).toBe(true);
expect(wrapper.find(SolutionCard).props()).toMatchObject(solutionInfoProp);
});
it('does not show solution card when there is not one', () => {
......@@ -74,6 +75,10 @@ describe('Vulnerability Footer', () => {
it('does show issue history when there is one', () => {
createWrapper({ ...minimumProps, feedback: feedbackProps });
expect(wrapper.contains(IssueNote)).toBe(true);
expect(wrapper.find(IssueNote).props()).toMatchObject({
feedback: feedbackProps,
project: minimumProps.project,
});
});
it('does not show issue history when there is not one', () => {
......
......@@ -57,9 +57,21 @@ describe VulnerabilitiesHelper do
subject { helper.vulnerability_finding_data(finding) }
it "returns finding information" do
it 'returns finding information' do
puts finding.to_json
expect(subject[:name]).not_to be_nil
expect(subject[:description]).not_to be_nil
expect(subject).to include(
:solution => finding.solution,
:remediation => nil,
:issue_feedback => finding.issue_feedback,
:project => finding.project,
:description => finding.description,
:identifiers => finding.identifiers,
:links => finding.links,
:location => finding.location,
:name => finding.name
)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment