Skip to content

Commit

Permalink
test added and comments removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria committed Oct 9, 2024
1 parent 6899414 commit ed88e66
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,49 @@ public void List_Only_Renders_Paragraphs()
actual.Should().Be("<ul class=\"HtmlEncode[[govuk-list govuk-list--bullet]]\"><li>AAA</li></ul>");
}

[Test]
public void Numbered_List_Renders()
{
// arrange
var stringWriter = new StringWriter();
var list = new List()
{
NodeType = "ordered-list",
Content = new List<IContent>
{
new ListItem
{
Content = new List<IContent>
{
new Paragraph
{
Content = new List<IContent> { new Text() }
}
}
},
new ListItem
{
Content = new List<IContent>
{
new Paragraph
{
Content = new List<IContent> { new Hyperlink() }
}
}

}
}
};
_textLinkRenderer.Render(Arg.Any<Text>()).Returns(new HtmlString("AAA"));
_hyperlinkRenderer.Render(Arg.Any<Hyperlink>()).Returns(new HtmlString("BBB"));

// act
var htmlContent = _sut.Render(list);
htmlContent.WriteTo(stringWriter, new HtmlTestEncoder());
var actual = stringWriter.ToString();

// assert
actual.Should().Be("<ol class=\"HtmlEncode[[govuk-list govuk-list--number]]\"><li>AAA</li><li>BBB</li></ol>");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public IHtmlContent Render(List item)
return null;
}

// if node type = ol then use tag builder for orderedlist
TagBuilder listTag;
string cssClass;
if (item.NodeType == "unordered-list")
Expand Down

0 comments on commit ed88e66

Please sign in to comment.