import testRule from 'stylelint-test-rule-tape';

import declarationStrictValue, { ruleName } from '../src';

const { rule } = declarationStrictValue;

// custom message
testRule(rule, {
  ruleName,
  skipBasicChecks: true,

  config: [
    'color',
    {
      message: 'Custom expected ${types} for "${value}" of "${property}"', // eslint-disable-line no-template-curly-in-string
    },
  ],

  reject: [
    {
      code: '.foo { color: #fff; }',
      message: `Custom expected variable or function for "#fff" of "color" (${ruleName})`,
      line: 1,
      column: 8,
    },
    {
      code: '.foo { color: red; }',
      message: `Custom expected variable or function for "red" of "color" (${ruleName})`,
      line: 1,
      column: 8,
    },
  ],
});

testRule(rule, {
  ruleName,
  skipBasicChecks: true,

  config: [
    'color',
    {
      message: 1234,
    },
  ],

  reject: [
    {
      code: '.foo { color: red; }',
      message: `Invalid option "{"message":1234}" for rule ${ruleName}`,
    },
  ],
});

@@ -241,32 +241,94 @@
  'color',%0A    %7B%0A
+      // eslint-disable-next-line no-template-curly-in-string%0A
       message: '
@@ -389,59 +389,8 @@
 %7D%22',
- // eslint-disable-line no-template-curly-in-string
 %0A   
@@ -618,32 +618,32 @@
 color: red; %7D',%0A
-
       message: %60
@@ -812,32 +812,504 @@
 cChecks: true,%0A%0A
+  config: %5B%0A    %5B'/color$/', 'fill', 'stroke'%5D,%0A    %7B%0A      ignoreVariables: false,%0A      // eslint-disable-next-line no-template-curly-in-string%0A      message: 'Custom expected $%7Btypes%7D for %22$%7Bvalue%7D%22 of %22$%7Bproperty%7D%22',%0A    %7D,%0A  %5D,%0A%0A  reject: %5B%0A    %7B%0A      code: '.foo %7B color: $red; %7D',%0A      message: %60Custom expected function for %22$red%22 of %22color%22 ($%7BruleName%7D)%60,%0A      line: 1,%0A      column: 8,%0A    %7D,%0A  %5D,%0A%7D);%0A%0AtestRule(rule, %7B%0A  ruleName,%0A  skipBasicChecks: true,%0A%0A
   config: %5B%0A    

add broken message interpolation