<div class="form-group container-representant-inactif">
<h3>{{'LZ01.Demande.OngletRepInactifs' | obtenirRessource}}</h3>
<table #tableauRepresentantDesactive datatable [dtOptions]="dtOptionsDesactive" class="tableau"
*ngIf="tblRepresentantsDesactives.length !== 0">
<thead class="header">
<tr>
<th>{{'LZ01.Demande.Nom' | obtenirRessource}}</th>
<th>{{'LZ01.Demande.PersonneRessource' | obtenirRessource}}</th>
<th>{{'LZ01.Representant.TypeDoc' | obtenirRessource}}</th>
<th>{{'LZ01.Demande.DateInscription' | obtenirRessource}}</th>
<th>{{'LZ01.Demande.Daterevocation' | obtenirRessource}}</th>
<th>{{'LZ01.Commun.Tableau.Actions' | obtenirRessource}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let representant of tblRepresentantsDesactives; let id = index">
<td>
<infos-representants [representant]="representant">
</infos-representants>
</td>
<td>
<span *ngIf="!representant.personneContact.nom && !representant.personneContact.prenom"> -- </span>
<span *ngIf="(!!representant.neq || !!representant.nomEntrepriseHorsQuebec || !!representant.nomEntreprise) &&
!!representant.personneContact.nom && !!representant.personneContact.prenom">
{{representant.personneContact.nom}}, {{representant.personneContact.prenom}}</span>
</td>
<td>
<span
*ngIf="representant.representantFormulaireProcuration.indFormulaireValid">{{obtenirDescriptionDocument(representant.representantFormulaireProcuration?.codeFormulaireProcuration)}}</span>
<span
*ngIf="!representant.representantFormulaireProcuration.indFormulaireValid">{{obtenirDescriptionRaisonNonValidite(representant.representantFormulaireProcuration?.codeRaisonRejetFormulaire)}}</span>
</td>
<td>
<span *ngIf="!!representant.dateDebut">
{{ representant.dateDebut|mask: '0000-00-00' }}</span>
</td>
<td>
<span *ngIf="!!representant.dateFin">
{{ representant.dateFin|mask: '0000-00-00' }}</span>
</td>
<td>
<button appTabulationFocus class="button bouton-outils icon-sans-texte icon-consulter"></button>
</td>
</tr>
</tbody>
</table>
<p *ngIf="tblRepresentantsDesactives.length === 0">
{{'LZ01.Demande.MessAucun' | obtenirRessource}}</p>
</div>
body {
font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
color: #333;
background-color: #fff;
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TableauRepresentantsDesactivesComponent } from './tableau-representants-desactives.component';
import { retourListeRepresentantsDesactivesMock } from 'src/testing/modeles/retour-liste-representantsDesactives.mock';
import { retourListeRaisonnonValiditeMock } from 'src/testing/modeles/retour-liste-raison-non-validite.mock';
import { retourListeFormulaireProcurationMock } from 'src/testing/modeles/retour-liste-formulaire-procuration.mock';
import { of } from 'rxjs';
import { ParametresM1Service } from 'src/app/noyau/services/parametres-m1/parametres-m1.service';
import { MaskPipeMock } from 'src/testing/pipe/mask.pipe.mock';
import { RessourcePipeMock } from 'src/testing/pipe/ressource.pipe.mock';
import { HttpClientModule } from '@angular/common/http';
import { DataTablesModule } from 'angular-datatables';
import { ActivatedRoute, Router } from '@angular/router';
import { MessageService } from 'src/app/noyau/services/message/message.service';
import { NO_ERRORS_SCHEMA } from '@angular/core';
describe('TableauRepresentantsDesactivesComponent', () => {
let component: TableauRepresentantsDesactivesComponent;
let fixture: ComponentFixture<TableauRepresentantsDesactivesComponent>;
let parametresM1ServiceSpy: {
obtenirListeRaisonNonValidite: jasmine.Spy,
obtenirListeFormulaireProcuration: jasmine.Spy
};
const router = { navigate: jasmine.createSpy('navigate') };
const noDemande = '12345';
const activatedRoute = of({
noSeq: '1002003000',
noDemande: '500600'
});
let messageServiceSpy: {
ajouterMessage: jasmine.Spy
};
beforeEach(async(() => {
parametresM1ServiceSpy = jasmine.createSpyObj('ParametresM1Service', ['obtenirListeRaisonNonValidite',
'obtenirListeFormulaireProcuration']);
parametresM1ServiceSpy.obtenirListeRaisonNonValidite.and.returnValue(of(retourListeRaisonnonValiditeMock));
parametresM1ServiceSpy.obtenirListeFormulaireProcuration.and.returnValue(of(retourListeFormulaireProcurationMock));
TestBed.configureTestingModule({
declarations: [ TableauRepresentantsDesactivesComponent, MaskPipeMock, RessourcePipeMock ],
imports: [HttpClientModule, DataTablesModule],
providers: [
{ provide: ActivatedRoute, useValue: { params: activatedRoute } },
{ provide: Router, useValue: router },
{ provide: MessageService, useValue: messageServiceSpy },
{ provide: ParametresM1Service, useValue: parametresM1ServiceSpy }
],
schemas: [NO_ERRORS_SCHEMA]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(TableauRepresentantsDesactivesComponent);
component = fixture.componentInstance;
component.tblRepresentantsDesactives = retourListeRepresentantsDesactivesMock;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('Le component est créé', () => {
expect(component).toBeTruthy();
});
it('obtenirDescriptionDocument(): devrait retourner la type de formulaire du document valide', () => {
// Arrange
// Act
component.ngOnInit();
// Assert
expect(component.obtenirDescriptionDocument(retourListeFormulaireProcurationMock[0].code))
.toEqual(retourListeFormulaireProcurationMock[0].description);
});
it('obtenirDescriptionRaisonNonValidite(): devrait retourner la raison de non validité du document', () => {
// Arrange
// Act
component.ngOnInit();
// Assert
expect(component.obtenirDescriptionRaisonNonValidite(retourListeRaisonnonValiditeMock[0].codeRaison))
.toEqual(retourListeRaisonnonValiditeMock[0].descriptionRaison);
});
});
This bin was created anonymously and its free preview time has expired. Get a free unrestricted account
Dismiss xShortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + [ | Indents selected lines |
ctrl + ] | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Clone Bin |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |