<commit_before>const { assert } = require('chai');
const expandPropertyShorthand = require('../src/expandShorthandProperty');

/**
 * Tests for {@link expandPropertyShorthand}
 * TODO: add tests for global values
 */
describe('expandPropertyShorthand', function () {
  describe('margin', function () {
    it('should return expanded for 1 property', function () {
      const result = expandPropertyShorthand('margin', '4px');

      assert.deepEqual(result, {
        'margin-top': '4px',
        'margin-right': '4px',
        'margin-bottom': '4px',
        'margin-left': '4px',
      });
    });

    it('should return expanded for 2 properties', function () {
      const result = expandPropertyShorthand('margin', '0 auto');

      assert.deepEqual(result, {
        'margin-top': '0',
        'margin-right': 'auto',
        'margin-bottom': '0',
        'margin-left': 'auto',
      });
    });

    it('should return expanded for 3 properties', function () {
      const result = expandPropertyShorthand('margin', '0 3px 10rem');

      assert.deepEqual(result, {
        'margin-top': '0',
        'margin-right': '3px',
        'margin-bottom': '10rem',
        'margin-left': '3px',
      });
    });

    it('should return expanded for 4 properties', function () {
      const result = expandPropertyShorthand('margin', 'auto 1px 3px 2em');

      assert.deepEqual(result, {
        'margin-top': 'auto',
        'margin-right': '1px',
        'margin-bottom': '3px',
        'margin-left': '2em',
      });
    });
  });

  describe('border', function () {
    it('should return expanded border with width, style, color', function () {
      const result = expandPropertyShorthand('border', '1px solid black');

      assert.deepEqual(result, {
        'border-width': '1px',
        'border-style': 'solid',
        'border-color': 'black',
      });
    });

    it('should return expanded border with color, width, style', function () {
      const result = expandPropertyShorthand('border', 'black 1px solid');

      assert.deepEqual(result, {
        'border-width': '1px',
        'border-style': 'solid',
        'border-color': 'black',
      });
    });

    it('should return expanded border with style, color', function () {
      const result = expandPropertyShorthand('border', 'solid black');

      assert.deepEqual(result, {
        'border-style': 'solid',
        'border-color': 'black',
      });
    });

    it('should return expanded border with just color', function () {
      const result = expandPropertyShorthand('border', 'black');

      assert.deepEqual(result, {
        'border-color': 'black',
      });
    });
  });

  describe('flex-flow', function () {
    it('should return expanded flex with just flex-direction', function () {
      const result = expandPropertyShorthand('flex-flow', 'row-reverse');

      assert.deepEqual(result, {
        'flex-direction': 'row-reverse',
      });
    });

    it('should return expanded flex with just flex-wrap', function () {
      const result = expandPropertyShorthand('flex-flow', 'nowrap');

      assert.deepEqual(result, {
        'flex-wrap': 'nowrap',
      });
    });

    it('should return expanded flex with flex-direction flex-wrap', function () {
      const result = expandPropertyShorthand('flex-flow', 'column nowrap');

      assert.deepEqual(result, {
        'flex-direction': 'column',
        'flex-wrap': 'nowrap',
      });
    });

    it('should return expanded flex with flex-wrap flex-direction', function () {
      const result = expandPropertyShorthand('flex-flow', 'nowrap column');

      assert.deepEqual(result, {
        'flex-direction': 'column',
        'flex-wrap': 'nowrap',
      });
    });
  });

  // ["square", "url('../img/dino.png')", "inside", "georgian inside", "lower-roman url('../img/dino.png') outside", "none", "inherit", "initial", "unset"]
  describe('list-style', function () {
    it('should return expanded list-style with just type', function () {
      const result = expandPropertyShorthand('list-style', 'sqaure');

      assert.deepEqual(result, {
        'list-style-type': 'sqaure',
      });
    });

    it('should return expanded list-style with just image', function () {
      const result = expandPropertyShorthand('list-style', "url('../img/dino.png')");

      assert.deepEqual(result, {
        'list-style-image': "url('../img/dino.png')",
      });
    });

    it('should return expanded list-style with just position', function () {
      const result = expandPropertyShorthand('list-style', 'inside');

      assert.deepEqual(result, {
        'list-style-position': 'inside',
      });
    });

    it('should return expanded list-style with type position', function () {
      const result = expandPropertyShorthand('list-style', 'georgian inside');

      assert.deepEqual(result, {
        'list-style-type': 'georgian',
        'list-style-position': 'inside',
      });
    });

    it('should return expanded list-style with just type image position', function () {
      const result = expandPropertyShorthand('list-style', "lower-roman url('../img/dino.png') outside");

      assert.deepEqual(result, {
        'list-style-type': 'lower-roman',
        'list-style-position': 'outside',
        'list-style-image': "url('../img/dino.png')",
      });
    });
  });


  describe('transition', function () {
    it('should return expanded transition for name duration', function () {
      const result = expandPropertyShorthand('transition', 'margin-left 4s');

      assert.deepEqual(result, {
        'transition-property': 'margin-left',
        'transition-duration': '4s',
      });
    });

    it('should return expanded transition for name duration delay', function () {
      const result = expandPropertyShorthand('transition', 'margin-left 4s 1s');

      assert.deepEqual(result, {
        'transition-property': 'margin-left',
        'transition-duration': '4s',
        'transition-delay': '1s',
      });
    });
<commit_msg>Add Tests for Outline and Padding<commit_after>const { assert } = require('chai');
const expandPropertyShorthand = require('../src/expandShorthandProperty');

/**
 * Tests for {@link expandPropertyShorthand}
 * TODO: add tests for global values
 */
describe('expandPropertyShorthand', function () {
  describe('margin', function () {
    it('should return expanded for 1 property', function () {
      const result = expandPropertyShorthand('margin', '4px');

      assert.deepEqual(result, {
        'margin-top': '4px',
        'margin-right': '4px',
        'margin-bottom': '4px',
        'margin-left': '4px',
      });
    });

    it('should return expanded for 2 properties', function () {
      const result = expandPropertyShorthand('margin', '0 auto');

      assert.deepEqual(result, {
        'margin-top': '0',
        'margin-right': 'auto',
        'margin-bottom': '0',
        'margin-left': 'auto',
      });
    });

    it('should return expanded for 3 properties', function () {
      const result = expandPropertyShorthand('margin', '0 3px 10rem');

      assert.deepEqual(result, {
        'margin-top': '0',
        'margin-right': '3px',
        'margin-bottom': '10rem',
        'margin-left': '3px',
      });
    });

    it('should return expanded for 4 properties', function () {
      const result = expandPropertyShorthand('margin', 'auto 1px 3px 2em');

      assert.deepEqual(result, {
        'margin-top': 'auto',
        'margin-right': '1px',
        'margin-bottom': '3px',
        'margin-left': '2em',
      });
    });
  });

  describe('padding', function () {
    it('should expand 1px', function () {
      const result = expandPropertyShorthand('padding', '1px');

      assert.deepEqual(result, {
        'padding-top': '1px',
        'padding-right': '1px',
        'padding-bottom': '1px',
        'padding-left': '1px',
      });
    });

    it('should expand 1px 2px', function () {
      const result = expandPropertyShorthand('padding', '1px 2px');

      assert.deepEqual(result, {
        'padding-top': '1px',
        'padding-right': '2px',
        'padding-bottom': '1px',
        'padding-left': '2px',
      });
    });

    it('should expand 1px 2px 3px', function () {
      const result = expandPropertyShorthand('padding', '1px 2px 3px');

      assert.deepEqual(result, {
        'padding-top': '1px',
        'padding-right': '2px',
        'padding-bottom': '3px',
        'padding-left': '2px',
      });
    });

    it('should expand 1px 2px 3px 4px', function () {
      const result = expandPropertyShorthand('padding', '1px 2px 3px 4px');

      assert.deepEqual(result, {
        'padding-top': '1px',
        'padding-right': '2px',
        'padding-bottom': '3px',
        'padding-left': '4px',
      });
    });
  });

  describe('border', function () {
    it('should return expanded border with width, style, color', function () {
      const result = expandPropertyShorthand('border', '1px solid black');

      assert.deepEqual(result, {
        'border-width': '1px',
        'border-style': 'solid',
        'border-color': 'black',
      });
    });

    it('should return expanded border with color, width, style', function () {
      const result = expandPropertyShorthand('border', 'black 1px solid');

      assert.deepEqual(result, {
        'border-width': '1px',
        'border-style': 'solid',
        'border-color': 'black',
      });
    });

    it('should return expanded border with style, color', function () {
      const result = expandPropertyShorthand('border', 'solid black');

      assert.deepEqual(result, {
        'border-style': 'solid',
        'border-color': 'black',
      });
    });

    it('should return expanded border with just color', function () {
      const result = expandPropertyShorthand('border', 'black');

      assert.deepEqual(result, {
        'border-color': 'black',
      });
    });
  });

  describe('flex-flow', function () {
    it('should return expanded flex with just flex-direction', function () {
      const result = expandPropertyShorthand('flex-flow', 'row-reverse');

      assert.deepEqual(result, {
        'flex-direction': 'row-reverse',
      });
    });

    it('should return expanded flex with just flex-wrap', function () {
      const result = expandPropertyShorthand('flex-flow', 'nowrap');

      assert.deepEqual(result, {
        'flex-wrap': 'nowrap',
      });
    });

    it('should return expanded flex with flex-direction flex-wrap', function () {
      const result = expandPropertyShorthand('flex-flow', 'column nowrap');

      assert.deepEqual(result, {
        'flex-direction': 'column',
        'flex-wrap': 'nowrap',
      });
    });

    it('should return expanded flex with flex-wrap flex-direction', function () {
      const result = expandPropertyShorthand('flex-flow', 'nowrap column');

      assert.deepEqual(result, {
        'flex-direction': 'column',
        'flex-wrap': 'nowrap',
      });
    });
  });

  // ["square", "url('../img/dino.png')", "inside", "georgian inside", "lower-roman url('../img/dino.png') outside", "none", "inherit", "initial", "unset"]
  describe('list-style', function () {
    it('should return expanded list-style with just type', function () {
      const result = expandPropertyShorthand('list-style', 'sqaure');

      assert.deepEqual(result, {
        'list-style-type': 'sqaure',
      });
    });

    it('should return expanded list-style with just image', function () {
      const result = expandPropertyShorthand('list-style', "url('../img/dino.png')");

      assert.deepEqual(result, {
        'list-style-image': "url('../img/dino.png')",
      });
    });

    it('should return expanded list-style with just position', function () {
      const result = expandPropertyShorthand('list-style', 'inside');

      assert.deepEqual(result, {
        'list-style-position': 'inside',
      });
    });

    it('should return expanded list-style with type position', function () {
      const result = expandPropertyShorthand('list-style', 'georgian inside');

      assert.deepEqual(result, {
        'list-style-type': 'georgian',
        'list-style-position': 'inside',
      });
    });

    it('should return expanded list-style with just type image position', function () {
      const result = expandPropertyShorthand('list-style', "lower-roman url('../img/dino.png') outside");

      assert.deepEqual(result, {
        'list-style-type': 'lower-roman',
        'list-style-position': 'outside',
        'list-style-image': "url('../img/dino.png')",
      });
    });
  });

  describe('outline', function () {
    it('should expand 1px solid #000', function () {
      const result = expandPropertyShorthand('outline', '1px solid #000');

      assert.deepEqual(result, { 'outline-width': '1px', 'outline-style': 'solid', 'outline-color': '#000' });
    });

    it('should expand solid 1px #000', function () {
      const result = expandPropertyShorthand('outline', 'solid 1px #000');

      assert.deepEqual(result, { 'outline-width': '1px', 'outline-style': 'solid', 'outline-color': '#000' });
    });

    it('should expand solid #000000 1px', function () {
      const result = expandPropertyShorthand('outline', 'solid #000000 1px');

      assert.deepEqual(result, { 'outline-width': '1px', 'outline-style': 'solid', 'outline-color': '#000000' });
    });

    it('should expand solid', function () {
      const result = expandPropertyShorthand('outline', 'solid');

      assert.deepEqual(result, { 'outline-style': 'solid' });
    });

    it('should expand black', function () {
      const result = expandPropertyShorthand('outline', 'black');

      assert.deepEqual(result, { 'outline-color': 'black' });
    });

    it('should expand 1px', function () {
      const result = expandPropertyShorthand('outline', '1px');

      assert.deepEqual(result, { 'outline-width': '1px' });
    });
  });


  describe('transition', function () {
    it('should return expanded transition for name duration', function () {
      const result = expandPropertyShorthand('transition', 'margin-left 4s');

      assert.deepEqual(result, {
        'transition-property': 'margin-left',
        'transition-duration': '4s',
      });
    });

    it('should return expanded transition for name duration delay', function () {
      const result = expandPropertyShorthand('transition', 'margin-left 4s 1s');

      assert.deepEqual(result, {
        'transition-property': 'margin-left',
        'transition-duration': '4s',
        'transition-delay': '1s',
      });
    });

{'fraction_non_alphanumeric': 0.171446128635805, 'fraction_numerical': 0.010787928444626518, 'mean_word_length': 2.826280041797283, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7469067', 'n_tokens_mistral': 4450, 'n_tokens_neox': 4272, 'n_words': 969}