// Padding Syntax Tests
// ====================

@include test-module('Padding Syntax') {

  // prefix
  // ------

  @include output-test('prefix') {
    // wide
    @include assert-setup('wide', $grid: 7 .5);
    @include assert-output(
      'Items should have 3 columns padding before.'
    ) {
      .test { @include prefix(3); }
      .expect { padding-left: 45%; }
    }

    // wider
    @include assert-setup('wider', $grid: 7 .5) {
      .spacer { @include span(1 no-gutters); }
      .test, .expect { overflow: hidden; }
    }
    @include assert-output(
      'Items should have 3 columns padding before.'
    ) {
      .test { @include prefix(3 wider); }
      .expect { padding-left: 50%; }
    }
  }

  // suffix
  // ------

  @include output-test('suffix') {
    // wide
    @include assert-setup('wide', $grid: (1 2 3 2 1) .25);
    @include assert-output(
      'Items should have 2 columns padding after.'
    ) {
      .test { @include suffix(last 2); }
      .expect { padding-right: 35%; }
    }

    // wider
    @include assert-setup('wider', $grid: (1 2 3 2 1) .25) {
      .spacer { @include span(last 1 no-gutters); }
      .test, .expect { overflow: hidden; }
    }
    @include assert-output(
      'Items should have 2 columns padding after.'
    ) {
      .test { @include suffix(2 at 3 wider); }
      .expect { padding-right: 57.5%; }
    }
  }

  // pad
  // ---

  @include output-test('pad') {
    // simple
    @include assert-setup('simple', $grid: (1 2 3 2 1) .25);
    @include assert-output(
      'Items should have 2 columns padding before and after.'
    ) {
      .test { @include pad(first 2, last 2); }
      .expect {
        padding-left: 35%;
        padding-right: 35%;
      }
    }

    // nested
    @include assert-setup('nested', $grid: 9 .5) {
      .nest { @include pad(1); }
    }
    @include assert-output(
      'Items should have 1 column padding before, and 2 after - nested.'
    ) {
      .test { @include pad(1 2 of 7); }
      .expect {
        padding-left: 15%;
        padding-right: 30%;
      }
    }

    // inside
    @include assert-setup('inside', $grid: 8 .25 inside);
    @include assert-output(
      'Items should have 2 columns padding before and after, and keep gutters.'
    ) {
      .test { @include pad(2); }
      .expect {
        padding-left: 26.25%;
        padding-right: 26.25%;
      }
    }

    // inside no-gutters
    @include assert-setup('inside-nogutters', $grid: 8 .25 inside);
    @include assert-output(
      'Items should have 2 columns padding before and after, without gutters.'
    ) {
      .test { @include pad(2 no-gutters); }
      .expect {
        padding-left: 25%;
        padding-right: 25%;
      }
    }
  }
}
