Skip to content

AC-945: Create unit test for Magento2\Less\CommentLevelsSniff check #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Magento2/Tests/Less/CommentLevelsUnitTest.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// /**
// * Copyright © Magento, Inc. All rights reserved.
// * See COPYING.txt for license details.
// */

//
// First level comment
// _____________________________________________

.first-level {
background-color: green;
}

//
// Incorrect First level comment
// _____________________________________________
.incorrect-first-level {
background-color: red;
}

//
// Second level comment
// ---------------------------------------------

.second-level {
background-color: green;
}

//
// Incorrect Second level comment
// ---------------------------------------------

.incorrect-second-level {
background-color: red;
}

// third level comment
.third-level-nav {
// New line comment, considered third level too
background-color: green; // ToDo UI: todo inline comment
color: white; // inline comment
}

//Incorrect third level comment
.incorrect-third-level {
// Incorrect new line comment
color: red; // incorrect inline comment
}
32 changes: 32 additions & 0 deletions Magento2/Tests/Less/CommentLevelsUnitTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* Copyright © Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento2\Tests\Less;

class CommentLevelsUnitTest extends AbstractLessSniffUnitTestCase
{
/**
* @inheritdoc
*/
public function getErrorList()
{
return [
16 => 1,
30 => 1,
31 => 1,
44 => 1,
46 => 1,
47 => 1
];
}

/**
* @inheritdoc
*/
public function getWarningList()
{
return [];
}
}