diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-03-30 21:31:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-30 21:31:05 +0300 |
commit | 09e1412dcd0e142c760eb5447af254a817b7b056 (patch) | |
tree | 1037930584499d7b2428351022f4a32733632659 /tests | |
parent | cee2b8e670c390c370aa51a02e0613848121ddab (diff) |
[Vue] standardize use of v-html with ReleaseChecklistTest (#19020)
* modify v-html use
* exclude node_modules from watch command
* force use of $sanitize w/ v-html through test + replace existing missing uses
* update tagmanager submodule
* remove accidental git add
Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PHPUnit/Integration/ReleaseCheckListTest.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/ReleaseCheckListTest.php b/tests/PHPUnit/Integration/ReleaseCheckListTest.php index 22373832d9..7994026a63 100644 --- a/tests/PHPUnit/Integration/ReleaseCheckListTest.php +++ b/tests/PHPUnit/Integration/ReleaseCheckListTest.php @@ -696,6 +696,31 @@ class ReleaseCheckListTest extends \PHPUnit\Framework\TestCase . implode(', ', $filesThatDoNotExist)); } + public function test_noVueHtmlWithoutSanitize() + { + $command = 'grep -r "v-html=" ' . PIWIK_INCLUDE_PATH . '/plugins --include=*.vue | grep -v "v-html=[\'\\"]\\$sanitize"'; + $output = shell_exec($command); + + $errorMessage = ""; + if (!empty($output)) { + $lines = explode("\n", $output); + + $files = []; + foreach ($lines as $line) { + if (empty(trim($line))) { + continue; + } + + list($file, $match) = explode(':', $line); + $files[] = '- ' . trim($file); + } + + $errorMessage = "Found uses of v-html without \$sanitize:\n" . implode("\n", $files); + } + + $this->assertEmpty($output, $errorMessage); + } + /** * @param $file * @return bool |