Skip to content

Commit

Permalink
🚨 Handle linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
superbuggy committed Dec 11, 2024
1 parent e52172a commit 0f0bdec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/FlawForm/PurlField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function validatePurl(purl: string) {
PackageURL.fromString(purl);
error.value = null;
return purl;
} catch (e) {
} catch (e: any) {
error.value = e.message;
return null;
}
Expand Down
9 changes: 4 additions & 5 deletions src/components/__tests__/PurlField.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ import { mount } from '@vue/test-utils';
import PurlField from '@/components/FlawForm/PurlField.vue';

describe('purlField.vue', () => {
it('should pass valid PURL test', async () => {
it('should pass valid PURL test', async () => {
const wrapper = mount(PurlField, { props: { purl: 'pkg:npm/%40angular/[email protected]' } });
// input.setValue('pkg:npm/%40angular/[email protected]');
// await input.trigger('input');
// @ts-expect-error error does not exist on wrapper vm
expect(wrapper.vm.error).toBeNull();
});

it('should pass invalid PURL test', async () => {
const wrapper = mount(PurlField);
const input = wrapper.find('input');
input.setValue('invalid-purl');
await input.trigger('input');

// @ts-expect-error error does not exist on wrapper vm
expect(wrapper.vm.error).not.toBeNull();
});
});

0 comments on commit 0f0bdec

Please sign in to comment.