File

src/lib/test-button.ts

Description

A wrapped button element, providing additional methods and attributes helping with writing tests

Extends

TestHtmlElement

Index

Methods

Constructor

constructor(tester: ComponentTester, debugElement: DebugElement)
Parameters :
Name Type Optional
tester ComponentTester<any> no
debugElement DebugElement no

Methods

click
click()
Inherited from TestHtmlElement
Defined in TestHtmlElement:16

Clicks on the wrapped element, then triggers a change detection

Returns : void

Accessors

disabled
getdisabled()

the disabled flag of the button

import { ComponentTester } from './component-tester';
import { TestHtmlElement } from './test-html-element';
import { DebugElement } from '@angular/core';

/**
 * A wrapped button element, providing additional methods and attributes helping with writing tests
 */
export class TestButton extends TestHtmlElement<HTMLButtonElement> {
  constructor(tester: ComponentTester<any>, debugElement: DebugElement) {
    super(tester, debugElement);
  }

  /**
   * the disabled flag of the button
   */
  get disabled() {
    return this.nativeElement.disabled;
  }
}

results matching ""

    No results matching ""