
Integrates airshipctl's config functionality with Airship UI to allow users to view and set airship configuration settings. Known issues: - Manifests currently only shows the primary (phase) repo. We'll probably need a separate repo sub-component to allow for showing / editing multiple repos - There are some boolean values which once set, cannot be unset using airshipctl's setters. We may need to write custom setters to set the Config struct values directly - It's possible to make edits to the config file that render the config invalid, so the CTL client cannot be initialized for subsequent edits. We'll probably want to make a copy of the original config, test the changes by initializing a new client, and only persist the changes if valid. - Lots and lots of cosmetic work remains to make the output more readable and easier to manage Change-Id: Ib29f3f6cf3e420b6e0e2cdc6afddd48c7e403137
74 lines
2.7 KiB
TypeScript
Executable File
74 lines
2.7 KiB
TypeScript
Executable File
/*
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
*/
|
|
|
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
import { ConfigComponent } from './config.component';
|
|
import { ToastrModule } from 'ngx-toastr';
|
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
import { MatButtonModule } from '@angular/material/button';
|
|
import { MatInputModule } from '@angular/material/input';
|
|
import { MatCardModule } from '@angular/material/card';
|
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
import { ConfigContextModule } from './config-context/config-context.module';
|
|
import { ConfigManagementModule } from './config-management/config-management.module';
|
|
import { ConfigManifestModule } from './config-manifest/config-manifest.module';
|
|
import { ConfigEncryptionModule } from './config-encryption/config-encryption.module';
|
|
import { ConfigManifestComponent } from './config-manifest/config-manifest.component';
|
|
import { ConfigManagementComponent } from './config-management/config-management.component';
|
|
import { ConfigEncryptionComponent } from './config-encryption/config-encryption.component';
|
|
import { ConfigContextComponent } from './config-context/config-context.component';
|
|
|
|
describe('ConfigComponent', () => {
|
|
let component: ConfigComponent;
|
|
let fixture: ComponentFixture<ConfigComponent>;
|
|
|
|
beforeEach(async(() => {
|
|
TestBed.configureTestingModule({
|
|
imports: [
|
|
ToastrModule.forRoot(),
|
|
FormsModule,
|
|
MatButtonModule,
|
|
MatInputModule,
|
|
MatCardModule,
|
|
MatCheckboxModule,
|
|
ConfigContextModule,
|
|
ConfigManagementModule,
|
|
ConfigManifestModule,
|
|
ConfigEncryptionModule,
|
|
ReactiveFormsModule
|
|
],
|
|
declarations: [
|
|
ConfigComponent,
|
|
ConfigManifestComponent,
|
|
ConfigManagementComponent,
|
|
ConfigEncryptionComponent,
|
|
ConfigContextComponent
|
|
],
|
|
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
})
|
|
.compileComponents();
|
|
}));
|
|
|
|
beforeEach(() => {
|
|
fixture = TestBed.createComponent(ConfigComponent);
|
|
component = fixture.componentInstance;
|
|
fixture.detectChanges();
|
|
});
|
|
|
|
it('should create', () => {
|
|
expect(component).toBeTruthy();
|
|
});
|
|
});
|