Extends

MockElement

Index

core/testing/src/mocks/link.mock.ts

Properties
Methods

Constructor

constructor()

Properties

Optional as
Type: string
Optional href
Type: string
Optional onerror
Type: function
Optional onload
Type: function
Optional rel
Type: string
relList
Type: object
Default value: { add: (...tokens: string[]) => this.rel = tokens.join(' ') }
Optional type
Type: string
Public children
Type: any[]
Default value: []
Inherited from MockElement
Public Optional className
Type: string
Inherited from MockElement
Public Optional dir
Type: "ltr" | "rtl"
Inherited from MockElement
Public Optional parentElement
Type: MockElement
Inherited from MockElement
Public Optional tagName
Type: string
Inherited from MockElement

Methods

Public appendChild
appendChild(node: any)
Inherited from MockElement
Parameters:
Name Type Optional
node any No
Returns: void
Public extractAttributesFromSelector
extractAttributesFromSelector(selector: string)
Inherited from MockElement

Extracts an array of {name, value} objects mapping the attributes from the specified selector string. Attributes with no value will be mapped with wildcard value (i.e. '**').

Parameters:
Name Type Optional
selector string No
Returns: any
Public querySelectorAll
querySelectorAll(selector: string)
Inherited from MockElement
Parameters:
Name Type Optional
selector string No
Returns: any[]
Public remove
remove()
Inherited from MockElement
Returns: void
Public removeChild
removeChild(node: any)
Inherited from MockElement
Parameters:
Name Type Optional
node any No
Returns: void
import { MockElement } from './element.mock';

export class MockLinkElement extends MockElement
{
    constructor() { super('link'); }

    as  ?: string;
    href?: string;
    type?: string;
    rel ?: string;
    relList = {
        add: (...tokens: string[]) => this.rel = tokens.join(' ')
    };
    
    onload ?: () => void;
    onerror?: () => void;
}

results matching ""

    No results matching ""