LinkExpectation

io.github.frikit.twirlspec.expect.LinkExpectation
final case class LinkExpectation(text: Expected, href: Option[String], id: Option[String]) extends Expectation

A link, by text and/or id, optionally pinned to a URL.

Attributes

Source
ContentExpectations.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Expectation
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def check(page: Page): Seq[Violation]

Empty means satisfied.

Empty means satisfied.

Attributes

Source
ContentExpectations.scala
def description: String

Human description, used when listing what a page was checked against.

Human description, used when listing what a page was checked against.

Attributes

Source
ContentExpectations.scala
def saying(key: String, args: Any*): LinkExpectation

What the link says, from a message key, for a link found by id.

What the link says, from a message key, for a link found by id.

Attributes

Source
ContentExpectations.scala
def to(url: String): LinkExpectation

The link points at this URL.

The link points at this URL.

Attributes

Source
ContentExpectations.scala
def withId(elementId: String): LinkExpectation

Find the link by this id instead of by its text.

Find the link by this id instead of by its text.

Attributes

Source
ContentExpectations.scala

Inherited methods

def and(other: Expectation): Expectation

Both this expectation and another, as one.

Both this expectation and another, as one.

Attributes

Inherited from:
Expectation
Source
Expectation.scala

Downgrade every violation this expectation produces to a warning.

Downgrade every violation this expectation produces to a warning.

Attributes

Inherited from:
Expectation
Source
Expectation.scala
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def when(p: Page => Boolean): Expectation

Only apply this expectation when the page satisfies a predicate.

Only apply this expectation when the page satisfies a predicate.

Attributes

Inherited from:
Expectation
Source
Expectation.scala