Search in sources :

Example 1 with Code

use of org.commonmark.node.Code in project hippo by NHS-digital-website.

the class CodeAttributeProviderTest method setsCodeInlineCssClassOnCodeElement.

@Test
public void setsCodeInlineCssClassOnCodeElement() {
    // given
    final Node nodeCode = new Code();
    // when
    codeAttributeProvider.setAttributes(nodeCode, "tagName is ignored", attributes);
    // then
    then(attributes).should().put("class", "nhsd-a-text-highlight nhsd-a-text-highlight--code");
    then(attributes).shouldHaveNoMoreInteractions();
}
Also used : Node(org.commonmark.node.Node) Code(org.commonmark.node.Code) Test(org.junit.Test)

Example 2 with Code

use of org.commonmark.node.Code in project hippo by NHS-digital-website.

the class ListAttributeProviderTest method ignoresElementOtherThanList.

@Test
public void ignoresElementOtherThanList() {
    // given
    final Node nodeOtherThanTable = new Code();
    // when
    listAttributeProvider.setAttributes(nodeOtherThanTable, "tagName is ignored", attributes);
    // then
    then(attributes).shouldHaveZeroInteractions();
}
Also used : Node(org.commonmark.node.Node) Code(org.commonmark.node.Code) Test(org.junit.Test)

Aggregations

Code (org.commonmark.node.Code)2 Node (org.commonmark.node.Node)2 Test (org.junit.Test)2