Skip to content

Commit

Permalink
updat e2e test snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Jan 26, 2025
1 parent 44ab34a commit f210cbc
Show file tree
Hide file tree
Showing 37 changed files with 261 additions and 269 deletions.
2 changes: 1 addition & 1 deletion src/utils/stylelint/formatting-options-to-rules.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type LSP from 'vscode-languageserver-protocol';

export type FormattingRules = {
indentation: [number | string];
indentation?: [number | string];
'no-missing-end-of-source-newline'?: true | null;
'no-eol-whitespace'?: true | null;
};
Expand Down
92 changes: 39 additions & 53 deletions test/e2e/__tests__/__snapshots__/code-actions.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,28 @@

exports[`Code actions should disable rules for a specific line with a comment on the previous line 1`] = `
"a {
/* stylelint-disable-next-line indentation */
font-size: 1.2em;
/* stylelint-disable-next-line comment-no-empty */
/* stylelint-disable-next-line value-keyword-case */
display: BLOCK;
/* stylelint-disable-next-line comment-no-empty */
color: #00;
}
"
`;

exports[`Code actions should disable rules for a specific line with a comment on the same line 1`] = `
"a {
font-size: 1.2em; /* stylelint-disable-line indentation */
/* stylelint-disable-next-line comment-no-empty */
display: BLOCK; /* stylelint-disable-line value-keyword-case */
/* stylelint-disable-next-line comment-no-empty */
color: #00;
}
"
`;

exports[`Code actions should disable rules for a specific line with a comment on the same line 2`] = `
"#!/usr/bin/env node
/* stylelint-disable color-no-invalid-hex */
/* eslint-disable node/shebang */
'use strict';
const css = css\`
.foo {
color: #00;
}
\`;
"
`;

exports[`Code actions should disable rules for an entire file 1`] = `
"/* stylelint-disable indentation */
"/* stylelint-disable value-keyword-case */
a {
font-size: 1.2em;
/* stylelint-disable-next-line comment-no-empty */
display: BLOCK;
/* stylelint-disable-next-line comment-no-empty */
color: #00;
}
"
Expand All @@ -58,22 +44,22 @@ const css = css\`
`;

exports[`Code actions should provide code actions for problems 1`] = `
Array [
Object {
"edit": Array [
Array [
[
{
"edit": [
[
"<uri>",
Array [
Object {
[
{
"newEol": undefined,
"newText": " /* stylelint-disable-next-line indentation */
"newText": " /* stylelint-disable-next-line value-keyword-case */
",
"range": Array [
Object {
"range": [
{
"character": 0,
"line": 1,
},
Object {
{
"character": 0,
"line": 1,
},
Expand All @@ -86,23 +72,23 @@ Array [
"kind": _ {
"value": "quickfix",
},
"title": "Disable indentation for this line",
"title": "Disable value-keyword-case for this line",
},
Object {
"edit": Array [
Array [
{
"edit": [
[
"<uri>",
Array [
Object {
[
{
"newEol": undefined,
"newText": "/* stylelint-disable indentation */
"newText": "/* stylelint-disable value-keyword-case */
",
"range": Array [
Object {
"range": [
{
"character": 0,
"line": 0,
},
Object {
{
"character": 0,
"line": 0,
},
Expand All @@ -115,32 +101,32 @@ Array [
"kind": _ {
"value": "quickfix",
},
"title": "Disable indentation for the entire file",
"title": "Disable value-keyword-case for the entire file",
},
Object {
"command": Object {
"arguments": Array [
Object {
"uri": "https://stylelint.io/user-guide/rules/indentation",
{
"command": {
"arguments": [
{
"uri": "https://stylelint.io/user-guide/rules/value-keyword-case",
},
],
"command": "stylelint.openRuleDoc",
"title": "Open documentation for indentation",
"title": "Open documentation for value-keyword-case",
},
"isPreferred": undefined,
"kind": _ {
"value": "quickfix",
},
"title": "Show documentation for indentation",
"title": "Show documentation for value-keyword-case",
},
]
`;

exports[`Code actions should run auto-fix action on save 1`] = `
"a {
font-size: 1.2em;
/* stylelint-disable-next-line comment-no-empty */
color: #00;
display: block;
/* stylelint-disable-next-line comment-no-empty */
color: #00;
}
"
`;
40 changes: 20 additions & 20 deletions test/e2e/__tests__/__snapshots__/config-basedir.ts.snap
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`"stylelint.configBasedir" setting should resolve referenced configs using the base directory 1`] = `
Array [
Object {
"code": "color-hex-case",
"codeDescription": Object {
"href": "https://stylelint.io/user-guide/rules/color-hex-case",
[
{
"code": "color-hex-alpha",
"codeDescription": {
"href": "https://stylelint.io/user-guide/rules/color-hex-alpha",
},
"message": "Expected \\"#fff\\" to be \\"#FFF\\" (color-hex-case)",
"range": Object {
"end": Object {
"character": 10,
"message": "Expected alpha channel in "#fff" (color-hex-alpha)",
"range": {
"end": {
"character": 13,
"line": 1,
},
"start": Object {
"start": {
"character": 9,
"line": 1,
},
},
"severity": 1,
"source": "Stylelint",
},
Object {
"code": "indentation",
"codeDescription": Object {
"href": "https://stylelint.io/user-guide/rules/indentation",
{
"code": "color-hex-length",
"codeDescription": {
"href": "https://stylelint.io/user-guide/rules/color-hex-length",
},
"message": "Expected indentation of 8 spaces (indentation)",
"range": Object {
"end": Object {
"character": 14,
"message": "Expected "#fff" to be "#ffffff" (color-hex-length)",
"range": {
"end": {
"character": 13,
"line": 1,
},
"start": Object {
"character": 2,
"start": {
"character": 9,
"line": 1,
},
},
Expand Down
12 changes: 6 additions & 6 deletions test/e2e/__tests__/__snapshots__/config-file.ts.snap
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`"stylelint.configFile" setting should resolve the config file using the specified path 1`] = `
Array [
Object {
[
{
"code": "block-no-empty",
"codeDescription": Object {
"codeDescription": {
"href": "https://stylelint.io/user-guide/rules/block-no-empty",
},
"message": "Unexpected empty block (block-no-empty)",
"range": Object {
"end": Object {
"range": {
"end": {
"character": 4,
"line": 0,
},
"start": Object {
"start": {
"character": 2,
"line": 0,
},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/__tests__/__snapshots__/custom-syntax.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
exports[`"stylelint.customSyntax" setting should auto-fix using the specified custom syntax 1`] = `
"/* prettier-ignore */
.foo .bar
color: red"
color: rgb(0 0 0)"
`;
50 changes: 25 additions & 25 deletions test/e2e/__tests__/__snapshots__/ignore-disables.ts.snap
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`"stylelint.ignoreDisables" setting should ignore disable directives when enabled 1`] = `
Array [
Object {
"code": "color-hex-case",
"codeDescription": Object {
"href": "https://stylelint.io/user-guide/rules/color-hex-case",
[
{
"code": "color-hex-length",
"codeDescription": {
"href": "https://stylelint.io/user-guide/rules/color-hex-length",
},
"message": "Expected \\"#fff\\" to be \\"#FFF\\" (color-hex-case)",
"range": Object {
"end": Object {
"character": 10,
"line": 3,
"message": "Expected "#fff" to be "#ffffff" (color-hex-length)",
"range": {
"end": {
"character": 18,
"line": 2,
},
"start": Object {
"character": 9,
"line": 3,
"start": {
"character": 14,
"line": 2,
},
},
"severity": 1,
"source": "Stylelint",
},
Object {
"code": "indentation",
"codeDescription": Object {
"href": "https://stylelint.io/user-guide/rules/indentation",
{
"code": "function-name-case",
"codeDescription": {
"href": "https://stylelint.io/user-guide/rules/function-name-case",
},
"message": "Expected indentation of 4 spaces (indentation)",
"range": Object {
"end": Object {
"character": 14,
"line": 3,
"message": "Expected "RGB" to be "rgb" (function-name-case)",
"range": {
"end": {
"character": 23,
"line": 2,
},
"start": Object {
"character": 2,
"line": 3,
"start": {
"character": 20,
"line": 2,
},
},
"severity": 1,
Expand Down
Loading

0 comments on commit f210cbc

Please sign in to comment.