mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
code cleanup (#3210)
* code cleanup * rollback changes * remove dead code * remove debug app config * cleanup unused locales * no-unused-vars rule * test fixes and cleanup * remove unnecessary translate modules
This commit is contained in:
@@ -23,14 +23,12 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { OpenInAppComponent } from './open-in-app.component';
|
||||
import { initialState, LibTestingModule } from '../../testing/lib-testing-module';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatIconTestingModule } from '@angular/material/icon/testing';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { SharedModule } from '@alfresco/aca-shared';
|
||||
|
||||
describe('OpenInAppComponent', () => {
|
||||
@@ -44,7 +42,7 @@ describe('OpenInAppComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [LibTestingModule, TranslateModule, SharedModule.forRoot(), MatIconModule, MatIconTestingModule],
|
||||
imports: [LibTestingModule, SharedModule.forRoot(), MatIconTestingModule],
|
||||
providers: [
|
||||
provideMockStore({ initialState }),
|
||||
{ provide: MAT_DIALOG_DATA, useValue: { redirectUrl: 'mockRedirectUrl' } },
|
||||
@@ -59,14 +57,13 @@ describe('OpenInAppComponent', () => {
|
||||
|
||||
it('should redirect to app when click on `Open in App` button` ', async () => {
|
||||
let currentLocation: string | string[];
|
||||
const windowStub: Window & typeof globalThis = {
|
||||
component.window = {
|
||||
location: {
|
||||
set href(value: string | string[]) {
|
||||
currentLocation = value;
|
||||
}
|
||||
}
|
||||
} as Window & typeof globalThis;
|
||||
component.window = windowStub;
|
||||
const saveButton = fixture.debugElement.query(By.css('[data-automation-id="open-in-app-button"]')).nativeElement;
|
||||
saveButton.dispatchEvent(new Event('click'));
|
||||
fixture.detectChanges();
|
||||
|
@@ -35,7 +35,7 @@ export interface OpenInAppDialogOptions {
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class OpenInAppComponent {
|
||||
private redirectUrl: string;
|
||||
private readonly redirectUrl: string;
|
||||
public window: Window & typeof globalThis = window;
|
||||
|
||||
constructor(
|
||||
|
Reference in New Issue
Block a user