Tests fixed
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
parent
114d919141
commit
c441edead4
|
@ -1,5 +1,5 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { OperationResultDialogComponent } from './operation-result-dialog.component';
|
||||
|
||||
describe('OperationResultDialogComponent', () => {
|
||||
|
@ -8,7 +8,12 @@ describe('OperationResultDialogComponent', () => {
|
|||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [OperationResultDialogComponent]
|
||||
declarations: [OperationResultDialogComponent],
|
||||
imports: [MatDialogModule],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: {} },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: { success: [], errors: [] } }
|
||||
]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
@ -20,4 +25,4 @@ describe('OperationResultDialogComponent', () => {
|
|||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
|
@ -4,32 +4,36 @@
|
|||
|
||||
<mat-dialog-content>
|
||||
<div class="search-container">
|
||||
<mat-form-field appearance="fill" class="search-string" joyrideStep="searchNameStep" text="Busca subredes por nombre para localizar una subred específica rápidamente.">
|
||||
<mat-form-field appearance="fill" class="search-string" joyrideStep="searchNameStep"
|
||||
text="Busca subredes por nombre para localizar una subred específica rápidamente.">
|
||||
<mat-label i18n="@@searchLabel">Buscar nombre del cliente</mat-label>
|
||||
<input matInput placeholder="Búsqueda" [(ngModel)]="filters['name']" i18n-placeholder="@@searchPlaceholder" (keyup.enter)="loadData()"
|
||||
i18n-placeholder="@@searchPlaceholder">
|
||||
<input matInput placeholder="Búsqueda" [(ngModel)]="filters['name']" i18n-placeholder="@@searchPlaceholder"
|
||||
(keyup.enter)="loadData()" i18n-placeholder="@@searchPlaceholder">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<button *ngIf="filters['name']" mat-icon-button matSuffix aria-label="Clear tree search" (click)="filters['name'] = ''; loadData()">
|
||||
<button *ngIf="filters['name']" mat-icon-button matSuffix aria-label="Clear tree search"
|
||||
(click)="filters['name'] = ''; loadData()">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
<mat-hint i18n="@@searchHint">Pulsar 'enter' para buscar</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="fill" class="search-string" joyrideStep="searchIpStep" text="Busca clientes por IP.">
|
||||
<mat-label i18n="@@searchLabel">Buscar IP</mat-label>
|
||||
<input matInput placeholder="Búsqueda" [(ngModel)]="filters['ip']" i18n-placeholder="@@searchPlaceholder" (keyup.enter)="loadData()"
|
||||
i18n-placeholder="@@searchPlaceholder">
|
||||
<input matInput placeholder="Búsqueda" [(ngModel)]="filters['ip']" i18n-placeholder="@@searchPlaceholder"
|
||||
(keyup.enter)="loadData()" i18n-placeholder="@@searchPlaceholder">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<button *ngIf="filters['ip']" mat-icon-button matSuffix aria-label="Clear tree search" (click)="filters['ip'] = ''; loadData()">
|
||||
<button *ngIf="filters['ip']" mat-icon-button matSuffix aria-label="Clear tree search"
|
||||
(click)="filters['ip'] = ''; loadData()">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
<mat-hint i18n="@@searchHint">Pulsar 'enter' para buscar</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="fill" class="search-string" joyrideStep="searchIpStep" text="Busca clientes por la MAC">
|
||||
<mat-label i18n="@@searchLabel">Buscar Mac</mat-label>
|
||||
<input matInput placeholder="Búsqueda" [(ngModel)]="filters['mac']" i18n-placeholder="@@searchPlaceholder" (keyup.enter)="loadData()"
|
||||
i18n-placeholder="@@searchPlaceholder">
|
||||
<input matInput placeholder="Búsqueda" [(ngModel)]="filters['mac']" i18n-placeholder="@@searchPlaceholder"
|
||||
(keyup.enter)="loadData()" i18n-placeholder="@@searchPlaceholder">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<button *ngIf="filters['mac']" mat-icon-button matSuffix aria-label="Clear tree search" (click)="filters['mac'] = ''; loadData()">
|
||||
<button *ngIf="filters['mac']" mat-icon-button matSuffix aria-label="Clear tree search"
|
||||
(click)="filters['mac'] = ''; loadData()">
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
<mat-hint i18n="@@searchHint">Pulsar 'enter' para buscar</mat-hint>
|
||||
|
@ -38,13 +42,12 @@
|
|||
|
||||
<app-loading [isLoading]="loading"></app-loading>
|
||||
<table *ngIf="!loading" mat-table [dataSource]="dataSource" class="mat-elevation-z8" joyrideStep="tableStep"
|
||||
text="Visualiza y administra las subredes listadas según los filtros aplicados.">
|
||||
text="Visualiza y administra las subredes listadas según los filtros aplicados.">
|
||||
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
|
||||
<th mat-header-cell *matHeaderCellDef> {{ column.header }} </th>
|
||||
<td mat-cell *matCellDef="let client">
|
||||
<ng-container *ngIf="column.columnDef === 'status'">
|
||||
<img [src]="'assets/images/ordenador_' + client.status + '.png'" alt="Client Icon"
|
||||
class="client-image" />
|
||||
<img [src]="'assets/images/ordenador_' + client.status + '.png'" alt="Client Icon" class="client-image" />
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="column.columnDef === 'ogLive'">
|
||||
|
@ -62,9 +65,9 @@
|
|||
</table>
|
||||
|
||||
<div class="paginator-container" joyrideStep="paginationStep"
|
||||
text="Navega entre las páginas de subredes usando el paginador.">
|
||||
text="Navega entre las páginas de subredes usando el paginador.">
|
||||
<mat-paginator [length]="length" [pageSize]="itemsPerPage" [pageIndex]="page" [pageSizeOptions]="pageSizeOptions"
|
||||
(page)="onPageChange($event)">
|
||||
(page)="onPageChange($event)">
|
||||
</mat-paginator>
|
||||
</div>
|
||||
|
||||
|
@ -72,4 +75,4 @@
|
|||
|
||||
<mat-dialog-actions class="action-container">
|
||||
<button class="ordinary-button" (click)="onNoClick()">Cancelar</button>
|
||||
</mat-dialog-actions>
|
||||
</mat-dialog-actions>
|
|
@ -1,22 +1,22 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ShowClientsComponent } from './show-clients.component';
|
||||
import {MatExpansionModule} from "@angular/material/expansion";
|
||||
import {MatIconModule} from "@angular/material/icon";
|
||||
import {MatDividerModule} from "@angular/material/divider";
|
||||
import {MatFormFieldModule} from "@angular/material/form-field";
|
||||
import {MatSelectModule} from "@angular/material/select";
|
||||
import {MatPaginatorModule} from "@angular/material/paginator";
|
||||
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
|
||||
import {FormsModule} from "@angular/forms";
|
||||
import {MatInputModule} from "@angular/material/input";
|
||||
import {MatTableModule} from "@angular/material/table";
|
||||
import {TranslateModule} from "@ngx-translate/core";
|
||||
import {JoyrideModule} from "ngx-joyride";
|
||||
import {MatDialog, MatDialogModule, MatDialogRef} from "@angular/material/dialog";
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {ToastrService} from "ngx-toastr";
|
||||
import {of} from "rxjs";
|
||||
import { MatExpansionModule } from "@angular/material/expansion";
|
||||
import { MatIconModule } from "@angular/material/icon";
|
||||
import { MatDividerModule } from "@angular/material/divider";
|
||||
import { MatFormFieldModule } from "@angular/material/form-field";
|
||||
import { MatSelectModule } from "@angular/material/select";
|
||||
import { MatPaginatorModule } from "@angular/material/paginator";
|
||||
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
||||
import { FormsModule } from "@angular/forms";
|
||||
import { MatInputModule } from "@angular/material/input";
|
||||
import { MatTableModule } from "@angular/material/table";
|
||||
import { TranslateModule } from "@ngx-translate/core";
|
||||
import { JoyrideModule } from "ngx-joyride";
|
||||
import { MatDialog, MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { ToastrService } from "ngx-toastr";
|
||||
import { of } from "rxjs";
|
||||
import { LoadingComponent } from '../../../shared/loading/loading.component';
|
||||
|
||||
describe('ShowClientsComponent', () => {
|
||||
let component: ShowClientsComponent;
|
||||
|
@ -33,7 +33,7 @@ describe('ShowClientsComponent', () => {
|
|||
mockHttpClient.post.and.returnValue(of({}));
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ShowClientsComponent],
|
||||
declarations: [ShowClientsComponent, LoadingComponent],
|
||||
imports: [
|
||||
MatExpansionModule,
|
||||
MatIconModule,
|
||||
|
@ -53,13 +53,11 @@ describe('ShowClientsComponent', () => {
|
|||
{ provide: MatDialog, useValue: mockDialog },
|
||||
{ provide: HttpClient, useValue: mockHttpClient },
|
||||
{ provide: ToastrService, useValue: mockToastrService },
|
||||
{
|
||||
provide: MatDialogRef,
|
||||
useValue: {}
|
||||
},
|
||||
{ provide: MatDialogRef, useValue: {} },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: {} },
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ShowClientsComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@ -69,4 +67,4 @@ describe('ShowClientsComponent', () => {
|
|||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,10 +1,10 @@
|
|||
import {Component, Inject, OnInit} from '@angular/core';
|
||||
import {ToastrService} from "ngx-toastr";
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from "@angular/material/dialog";
|
||||
import {MatTableDataSource} from "@angular/material/table";
|
||||
import {Subnet} from "../og-dhcp-subnets.component";
|
||||
import {Client} from "../../groups/model/model";
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { ToastrService } from "ngx-toastr";
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from "@angular/material/dialog";
|
||||
import { MatTableDataSource } from "@angular/material/table";
|
||||
import { Subnet } from "../og-dhcp-subnets.component";
|
||||
import { Client } from "../../groups/model/model";
|
||||
|
||||
@Component({
|
||||
selector: 'app-show-clients',
|
||||
|
|
Loading…
Reference in New Issue