diff --git a/core-web/libs/block-editor/src/lib/components/dot-block-editor/dot-block-editor.component.spec.ts b/core-web/libs/block-editor/src/lib/components/dot-block-editor/dot-block-editor.component.spec.ts index 101d23d2e017..4909127a0772 100644 --- a/core-web/libs/block-editor/src/lib/components/dot-block-editor/dot-block-editor.component.spec.ts +++ b/core-web/libs/block-editor/src/lib/components/dot-block-editor/dot-block-editor.component.spec.ts @@ -43,7 +43,7 @@ const BLOCK_EDITOR_FIELD = { standalone: true, template: `
` }) @@ -66,24 +66,9 @@ describe('DotBlockEditorComponent - ControlValueAccesor', () => { it('should set form value when binary file changes', () => { const blockEditorComponent = spectator.query(DotBlockEditorComponent); - blockEditorComponent.value = BLOCK_EDITOR_FIELD; + blockEditorComponent.writeValue(BLOCK_EDITOR_FIELD); const formValue = spectator.component.form.get('block').value; - const expected = { - type: 'doc', - content: [ - { - type: 'paragraph', - attrs: { textAlign: 'left' }, - content: [ - { - type: 'text', - text: '{"attrs":{"charCount":9,"readingTime":1,"wordCount":2},"content":[{"attrs":{"level":1,"textAlign":"left"},"content":[{"text":"A title!!","type":"text"}],"type":"heading"}],"type":"doc"}' - } - ] - } - ] - }; - expect(formValue).toEqual(JSON.stringify(expected)); + expect(formValue).toEqual(JSON.stringify(BLOCK_EDITOR_FIELD)); }); }); diff --git a/core-web/libs/block-editor/src/lib/extensions/ai-content-prompt/ai-content-prompt.component.spec.ts b/core-web/libs/block-editor/src/lib/extensions/ai-content-prompt/ai-content-prompt.component.spec.ts index ee56921f406b..353198d590d5 100644 --- a/core-web/libs/block-editor/src/lib/extensions/ai-content-prompt/ai-content-prompt.component.spec.ts +++ b/core-web/libs/block-editor/src/lib/extensions/ai-content-prompt/ai-content-prompt.component.spec.ts @@ -1,28 +1,32 @@ -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; +import { Spectator, createComponentFactory } from '@ngneat/spectator/jest'; -import { DotAiService } from '@dotcms/data-access'; +import { provideHttpClient } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { AIContentPromptComponent } from './ai-content-prompt.component'; +import { ConfirmationService } from 'primeng/api'; -describe('AIContentPromptComponent', () => { - let component: AIContentPromptComponent; - let fixture: ComponentFixture