use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class ElementWithGivenIdPresentCheckTest method test_angular.
@Test
public void test_angular() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ElementWithGivenIdPresentCheck/Angular_Ok.html"), new ElementWithGivenIdPresentCheck());
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class ElementWithGivenIdPresentCheckTest method custom_ko.
@Test
public void custom_ko() throws Exception {
ElementWithGivenIdPresentCheck check = new ElementWithGivenIdPresentCheck();
check.id = "gotit";
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ElementWithGivenIdPresentCheck/Ko.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().withMessage("The ID \"gotit\" is missing from this page and should be added.");
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class ElementWithGivenIdPresentCheckTest method test.
@Test
public void test() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ElementWithGivenIdPresentCheck/Ok.html"), new ElementWithGivenIdPresentCheck());
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class IndistinguishableSimilarElementsCheckTest method multipleNavAside.
@Test
public void multipleNavAside() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/IndistinguishableSimilarElementsCheck/MultipleNavAside.html"), new IndistinguishableSimilarElementsCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(1, 0, 1, 5).withMessage("Add an \"aria-label\" or \"aria-labbelledby\" attribute to this element.").next().atLine(4).next().atLine(13).next().atLine(16).next().atLine(25).next().atLine(28).next().atLine(31).next().atLine(55);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class IndistinguishableSimilarElementsCheckTest method singleNavAside.
@Test
public void singleNavAside() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/IndistinguishableSimilarElementsCheck/SingleNavAside.html"), new IndistinguishableSimilarElementsCheck());
checkMessagesVerifier.verify(sourceCode.getIssues());
}
Aggregations