Skip to content

Commit

Permalink
Console cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-eyds committed Dec 5, 2023
1 parent c72ed6f commit ac72758
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ppr-ui/src/utils/form-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ export function focusOnFirstError(formName: string): void {
// Scroll to first designated error on Information or Review page
export async function scrollToFirstErrorComponent(defaultIndex: number = 0): Promise<void> {
setTimeout(() => {
document.getElementsByClassName('border-error-left').length > 0 &&
document
.getElementsByClassName('border-error-left')[defaultIndex]
document?.getElementsByClassName('border-error-left').length > 0 &&
document?.getElementsByClassName('border-error-left')[defaultIndex]
.scrollIntoView({ block: 'start', inline: 'nearest', behavior: 'smooth' })
}, 500)
}
Expand Down
12 changes: 12 additions & 0 deletions ppr-ui/tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ beforeAll(() => {
}
})

// Stub the SbcHeader component
vi.mock('../node_modules/sbc-common-components/src/components/SbcHeader.vue', () => {
// Replace the component with a dummy component or return an empty object
return {
default: {
render () {
return null
}
}
}
})

// Mock the WysiwygEditors (imported editor portion) component functions
global.ClipboardEvent = class ClipboardEvent {
constructor(type, eventInitDict) {
Expand Down

0 comments on commit ac72758

Please sign in to comment.