1 import { ComponentFixture, TestBed } from '@angular/core/testing';
3 import { RgwStorageClassDetailsComponent } from './rgw-storage-class-details.component';
4 import { StorageClassDetails } from '../models/rgw-storage-class.model';
5 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
6 import { SharedModule } from '~/app/shared/shared.module';
7 import { HttpClientTestingModule } from '@angular/common/http/testing';
8 import { RouterTestingModule } from '@angular/router/testing';
10 describe('RgwStorageClassDetailsComponent', () => {
11 let component: RgwStorageClassDetailsComponent;
12 let fixture: ComponentFixture<RgwStorageClassDetailsComponent>;
14 beforeEach(async () => {
15 await TestBed.configureTestingModule({
17 BrowserAnimationsModule,
19 HttpClientTestingModule,
22 declarations: [RgwStorageClassDetailsComponent]
23 }).compileComponents();
25 fixture = TestBed.createComponent(RgwStorageClassDetailsComponent);
26 component = fixture.componentInstance;
27 fixture.detectChanges();
30 it('should create', () => {
31 expect(component).toBeTruthy();
34 it('should update storageDetails when selection input changes', () => {
35 const mockSelection: StorageClassDetails = {
36 access_key: 'TestAccessKey',
38 target_path: '/test/path',
39 multipart_min_part_size: 100,
40 multipart_sync_threshold: 200,
42 retain_head_object: true,
43 allow_read_through: true
45 component.selection = mockSelection;
46 component.ngOnChanges();
47 expect(component.storageDetails).toEqual(mockSelection);