feat: add persistance to language selection

This commit is contained in:
2025-12-23 23:48:35 -03:00
parent 06f1769f5c
commit 882b0e2132
11 changed files with 74 additions and 26 deletions

View File

@@ -1,22 +1,24 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ContactForm } from './contact-form';
import { STRINGS_INJECTOR } from '../../app.config';
import { strings } from '../../strings';
import { By } from '@angular/platform-browser';
import { ContactDTO } from '../../models/ContactDTO';
import { LanguageManager } from '../../services/language-manager';
describe('ContactForm', () => {
let component: ContactForm;
let fixture: ComponentFixture<ContactForm>;
let languageManager: jasmine.SpyObj<LanguageManager>;
beforeEach(async () => {
languageManager = jasmine.createSpyObj(LanguageManager.name, [], { strings: strings.en });
await TestBed.configureTestingModule({
imports: [ContactForm],
providers: [{ provide: STRINGS_INJECTOR, useValue: strings }],
providers: [{ provide: LanguageManager, useValue: languageManager }],
}).compileComponents();
TestBed.inject(STRINGS_INJECTOR);
fixture = TestBed.createComponent(ContactForm);
component = fixture.componentInstance;
fixture.detectChanges();