Skip to content

Commit

Permalink
✅ Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Valen committed Jan 15, 2025
1 parent e1a3daf commit 50bf572
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
5 changes: 3 additions & 2 deletions src/components/__tests__/FlawForm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import FlawForm from '@/components/FlawForm/FlawForm.vue';
import CvssCalculator from '@/components/CvssCalculator/CvssCalculator.vue';
import FlawFormOwner from '@/components/FlawFormOwner/FlawFormOwner.vue';
import IssueFieldEmbargo from '@/components/IssueFieldEmbargo/IssueFieldEmbargo.vue';
import CweSelector from '@/components/CweSelector/CweSelector.vue';

import { blankFlaw } from '@/composables/useFlaw';

Expand Down Expand Up @@ -106,7 +107,7 @@ describe('flawForm', () => {
expect(nvdCvssField?.exists()).toBe(true);

const cweIdField = subject
.findAllComponents(LabelEditable)
.findAllComponents(CweSelector)
.find(component => component.props().label === 'CWE ID');
expect(cweIdField?.exists()).toBe(true);

Expand Down Expand Up @@ -187,7 +188,7 @@ describe('flawForm', () => {
expect(nvdCvssField?.exists()).toBe(true);

const cweIdField = subject
.findAllComponents(LabelEditable)
.findAllComponents(CweSelector)
.find(component => component.props().label === 'CWE ID');
expect(cweIdField?.exists()).toBe(true);

Expand Down
30 changes: 17 additions & 13 deletions src/components/__tests__/__snapshots__/FlawForm.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,26 @@ exports[`flawForm > mounts and renders 1`] = `
</div>
</div>
<!--v-if-->
</div><label data-v-76509415="" data-v-76e7a15d="" class="osim-input ps-3 mb-2 input-group">
<div data-v-76509415="" class="row"><span data-v-76509415="" class="form-label col-3">CWE ID</span>
<!--v-if-->
<!-- for invalid-tooltip positioning -->
<div data-v-76509415="" class="position-relative col-9 osim-editable-field osim-text">
<!--<Transition name="flash-bg" :duration="2000">-->
<transition-stub name="flash-bg" appear="false" persisted="true" css="true">
<div class="osim-editable-text" tabindex="0"><span class="osim-editable-text-value form-control">CWE-1</span>
<!--if a button is inside a label, clicking the label clicks the button?--><button type="button" class="osim-editable-text-pen input-group-text" tabindex="-1"><i class="bi bi-pencil"></i></button>
</div>
<div data-v-0e2ae48e="" data-v-76e7a15d="" class="osim-input ps-3 mb-2 mb-2">
<div data-v-0e2ae48e="" class="row"><span data-v-0e2ae48e="" class="form-label col-3 position-relative"><!--v-if--> CWE ID <!--attrs: {{ $attrs }}--></span>
<div data-v-0e2ae48e="" class="col-9">
<!-- for invalid-tooltip positioning -->
<div class="position-relative col-9 osim-editable-field osim-text col-12">
<!--<Transition name="flash-bg" :duration="2000">-->
<transition-stub name="flash-bg" appear="false" persisted="true" css="true">
<div class="osim-editable-text" tabindex="0"><span class="osim-editable-text-value form-control">CWE-1</span>
<!--if a button is inside a label, clicking the label clicks the button?--><button type="button" class="osim-editable-text-pen input-group-text" tabindex="-1"><i class="bi bi-pencil"></i></button>
</div>
</transition-stub>
<div class="input-group position-relative" tabindex="-1" style="display: none;">
<!--v-if--><input class="form-control" type="text"><button type="button" class="input-group-text" tabindex="-1"><i class="bi bi-check"></i></button><button type="button" class="input-group-text" tabindex="-1"><i class="bi bi-x"></i></button>
</div>
</transition-stub>
<div class="input-group" style="display: none;"><input class="form-control" type="text"><button type="button" class="input-group-text" tabindex="-1"><i class="bi bi-check"></i></button><button type="button" class="input-group-text" tabindex="-1"><i class="bi bi-x"></i></button></div>
<!--v-if-->
<!--v-if-->
</div>
</div>
</div>
</label><label data-v-001a00e0="" data-v-76e7a15d="" class="osim-input mb-2 ps-3">
</div><label data-v-001a00e0="" data-v-76e7a15d="" class="osim-input mb-2 ps-3">
<div data-v-001a00e0="" class="row"><span data-v-001a00e0="" class="form-label col-3">CVE Source</span>
<div data-v-001a00e0="" class="col-9"><select data-v-001a00e0="" class="form-select" value="GIT">
<!--v-if-->
Expand Down
30 changes: 17 additions & 13 deletions src/views/__tests__/__snapshots__/FlawCreateView.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,26 @@ exports[`flawCreateView > should render 1`] = `
</div>
</div>
<!--v-if-->
</div><label data-v-76509415="" data-v-76e7a15d="" class="osim-input ps-3 mb-2 input-group">
<div data-v-76509415="" class="row"><span data-v-76509415="" class="form-label col-3">CWE ID</span>
<!--v-if-->
<!-- for invalid-tooltip positioning -->
<div data-v-76509415="" class="position-relative col-9 osim-editable-field osim-text">
<!--<Transition name="flash-bg" :duration="2000">-->
<transition-stub name="flash-bg" appear="false" persisted="true" css="true">
<div class="osim-editable-text" tabindex="0"><span class="osim-editable-text-value form-control"></span>
<!--if a button is inside a label, clicking the label clicks the button?--><button type="button" class="osim-editable-text-pen input-group-text" tabindex="-1"><i class="bi bi-pencil"></i></button>
</div>
<div data-v-0e2ae48e="" data-v-76e7a15d="" class="osim-input ps-3 mb-2 mb-2">
<div data-v-0e2ae48e="" class="row"><span data-v-0e2ae48e="" class="form-label col-3 position-relative"><!--v-if--> CWE ID <!--attrs: {{ $attrs }}--></span>
<div data-v-0e2ae48e="" class="col-9">
<!-- for invalid-tooltip positioning -->
<div class="position-relative col-9 osim-editable-field osim-text col-12">
<!--<Transition name="flash-bg" :duration="2000">-->
<transition-stub name="flash-bg" appear="false" persisted="true" css="true">
<div class="osim-editable-text" tabindex="0"><span class="osim-editable-text-value form-control"></span>
<!--if a button is inside a label, clicking the label clicks the button?--><button type="button" class="osim-editable-text-pen input-group-text" tabindex="-1"><i class="bi bi-pencil"></i></button>
</div>
</transition-stub>
<div class="input-group position-relative" tabindex="-1" style="display: none;">
<!--v-if--><input class="form-control" type="text"><button type="button" class="input-group-text" tabindex="-1"><i class="bi bi-check"></i></button><button type="button" class="input-group-text" tabindex="-1"><i class="bi bi-x"></i></button>
</div>
</transition-stub>
<div class="input-group" style="display: none;"><input class="form-control" type="text"><button type="button" class="input-group-text" tabindex="-1"><i class="bi bi-check"></i></button><button type="button" class="input-group-text" tabindex="-1"><i class="bi bi-x"></i></button></div>
<!--v-if-->
<!--v-if-->
</div>
</div>
</div>
</label><label data-v-001a00e0="" data-v-76e7a15d="" class="osim-input mb-2 ps-3">
</div><label data-v-001a00e0="" data-v-76e7a15d="" class="osim-input mb-2 ps-3">
<div data-v-001a00e0="" class="row"><span data-v-001a00e0="" class="form-label col-3">CVE Source</span>
<div data-v-001a00e0="" class="col-9"><select data-v-001a00e0="" class="form-select is-invalid" value="">
<!--v-if-->
Expand Down

0 comments on commit 50bf572

Please sign in to comment.