Skip to content

Commit

Permalink
feat(plex-options): cambia button por plex-button
Browse files Browse the repository at this point in the history
  • Loading branch information
palita1991 authored and ma7payne committed Jul 25, 2023
1 parent 7005996 commit 9e6c805
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
10 changes: 2 additions & 8 deletions cypress/integration/template-listado.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,13 @@ context('template listado', () => {
});

it('test accordion', () => {
cy.eyesCheckWindow('main');

// SE SACO PORQUE PISARON TODA UNA COMPONENTE
// cy.get('plex-title').plexButtonIcon('chevron-down').click();
// cy.eyesCheckWindow('modal');

// cy.plexButton('CANCELAR').click();
cy.eyesCheckWindow('main');;

cy.get('plex-list plex-item').eq(0).plexButtonIcon('eye').click();

cy.eyesCheckWindow('item list selected');

cy.get('plex-options button').eq(0).click();
cy.get('plex-options').plexButton('opcion 1').eq(0).click();

cy.eyesCheckWindow('plex-options');

Expand Down
19 changes: 14 additions & 5 deletions src/lib/css/plex-options.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
plex-options {
.options-container {
display: flex;
}

.option-grow {
plex-button {
flex-grow: 1;

&.active {
button {
color: #fff;
background-color: #0082ad;
background-image: none;
border-color: #007aa3;
}
}

button {
width: 100%;
}
}
}
4 changes: 3 additions & 1 deletion src/lib/options/options.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Component, DebugElement, Type, ViewChild, ViewEncapsulation } from '@an
import { PlexOptionsComponent, IPlexOptionsItems } from './options.component';
import { PlexModule } from '../module';
import { FormsModule } from '@angular/forms';
import { Plex } from '../core/service';

describe('PlexOptionsComponent', () => {
let fixture: ComponentFixture<PlexOptionsTestComponent>;
Expand Down Expand Up @@ -134,7 +135,8 @@ function createTestingModule<T>(cmp: Type<T>, template: string): ComponentFixtur

TestBed.configureTestingModule({
imports: [BrowserModule, PlexModule, FormsModule],
declarations: [cmp]
declarations: [cmp],
providers: [Plex]
})
.overrideComponent(cmp, {
set: {
Expand Down
14 changes: 6 additions & 8 deletions src/lib/options/options.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ export interface IPlexOptionsItems {
@Component({
selector: 'plex-options',
template: `
<div class="row">
<div class="d-flex col flex-wrap">
<ng-container *ngFor="let item of items">
<button class="btn btn-primary btn-sm option-grow m-0" (click)="onOptionsClick(item)" [class.active]="active === item.key">
{{ item.label }}
</button>
</ng-container>
<div class="row">
<div class="d-flex col flex-wrap">
<ng-container *ngFor="let item of items">
<plex-button [type]="info" [size]="sm" [label]="item.label" (click)="onOptionsClick(item)" class="active === item.key"></plex-button>
</ng-container>
</div>
</div>
</div>
`
})
export class PlexOptionsComponent implements OnInit, OnChanges {
Expand Down

0 comments on commit 9e6c805

Please sign in to comment.