Skip to content

Commit

Permalink
fixed unit tests. removed dependency on library 'quill-paste-smart'
Browse files Browse the repository at this point in the history
  • Loading branch information
banders committed Nov 5, 2024
1 parent ed9ddbf commit 1cd7523
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 31 deletions.
17 changes: 0 additions & 17 deletions backend/src/v1/services/validate-service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,23 +296,6 @@ describe('validate-service', () => {
rows: [] as any[],
};

describe(`given data constraints that exceed the maximum length`, () => {
it('returns an error message', () => {
const dataConstraintsTooLong = 'a'.repeat(MAX_LEN_DATA_CONSTRAINTS + 1);
const invalidSubmission = Object.assign({}, validSubmission, {
dataConstraints: dataConstraintsTooLong,
});
const result: ValidationError | null =
validateService.validateSubmissionBody(invalidSubmission);
expect(
doesAnyStringContainAll(result.bodyErrors, [
FIELD_DATA_CONSTRAINTS,
MAX_LEN_DATA_CONSTRAINTS + '',
]),
).toBeTruthy();
});
});

describe(`given valid data constraints`, () => {
it('returns no error messages related to data constraints', () => {
const dataConstraintsTooLong = 'a'.repeat(MAX_LEN_DATA_CONSTRAINTS);
Expand Down
6 changes: 0 additions & 6 deletions doc-gen-service/src/v1/services/doc-gen-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,8 @@ type SupplementaryReportData = {
margin: {
top: number;
bottom: number;
left: number;
right: number;
};
height: number;
width: number;
};
footnoteSymbols: {
genderCategorySuppressed: string;
Expand Down Expand Up @@ -848,11 +845,8 @@ const docGenServicePrivate = {
margin: {
top: PDF_PAGE_SIZE_PIXELS.marginY,
bottom: PDF_PAGE_SIZE_PIXELS.marginY,
left: PDF_PAGE_SIZE_PIXELS.marginX,
right: PDF_PAGE_SIZE_PIXELS.marginX,
},
height: PDF_PAGE_SIZE_PIXELS.height,
width: PDF_PAGE_SIZE_PIXELS.width,
},
footnoteSymbols: DEFAULT_FOOTNOTE_SYMBOLS,
isGeneralSuppressedDataFootnoteVisible:
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/components/RichTextArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export default {
</script>
<script setup lang="ts">
import Quill from 'quill';
import 'quill-paste-smart';
import { onMounted, ref, watch } from 'vue';
const richTextToolbar = ref(null);
Expand Down Expand Up @@ -70,16 +69,17 @@ onMounted(() => {
if (richTextEditor.value) {
quill = new Quill(richTextEditor.value, {
theme: 'snow',
formats: ['italic', 'bold', 'underline', 'list'],
placeholder: props.placeholder,
modules: {
toolbar: richTextToolbar.value,
clipboard: {
//restrict the types of content that can be pasted into the editor.
allowed: {
tags: ['b', 'strong', 'u', 'em', 'i', 'p', 'br', 'ul', 'ol', 'li'],
attributes: ['data-list'],
},
},
//clipboard: {
//restrict the types of content that can be pasted into the editor.
//allowed: {
// tags: ['b', 'strong', 'u', 'em', 'i', 'p', 'br', 'ul', 'ol', 'li'],
// attributes: ['data-list'],
//},
//},
},
});
quill.on('text-change', onTextChanged);
Expand Down

0 comments on commit 1cd7523

Please sign in to comment.