@include test-module('oFonts') {
	$original-o-fonts-families-included: $_o-fonts-families-included;
	@include test('Includes default fonts when given no options') {

		@include oFonts();

		// The font faces are output.
		// o-fonts keeps track of included fonts, we can't test font-faces
		// with true-sass so test against this private variable and reset
		// it for each test :mask:
		@include assert-equal(
			$_o-fonts-families-included,
			(
				'MetricWeb-thin-normal': true,
				'MetricWeb-light-normal': true,
				'MetricWeb-light-italic': true,
				'MetricWeb-regular-normal': true,
				'MetricWeb-regular-italic': true,
				'MetricWeb-medium-normal': true,
				'MetricWeb-semibold-normal': true,
				'MetricWeb-bold-normal': true,
				'MetricWeb-bold-italic': true,
				'MetricWeb-black-normal': true,
				'FinancierDisplayWeb-light-normal': true,
				'FinancierDisplayWeb-light-italic': true,
				'FinancierDisplayWeb-regular-normal': true,
				'FinancierDisplayWeb-regular-italic': true,
				'FinancierDisplayWeb-medium-italic': true,
				'FinancierDisplayWeb-medium-normal': true,
				'FinancierDisplayWeb-semibold-normal': true,
				'FinancierDisplayWeb-semibold-italic': true,
				'FinancierDisplayWeb-bold-normal': true,
				'FinancierDisplayWeb-black-normal': true
			)
		);
		$_o-fonts-families-included: $original-o-fonts-families-included !global;
	}

	@include test('Includes recommended fonts only when "recommended" option given') {

		@include oFonts(('recommended': true));

		// The font faces are output.
		// o-fonts keeps track of included fonts, we can't test font-faces
		// with true-sass so test against this private variable and reset
		// it for each test :mask:
		@include assert-equal(
			$_o-fonts-families-included,
			(
				'MetricWeb-regular-normal': true,
				'MetricWeb-semibold-normal': true,
				'FinancierDisplayWeb-medium-normal': true,
				'FinancierDisplayWeb-bold-normal': true
			)
		);
		$_o-fonts-families-included: $original-o-fonts-families-included !global;
	}

	@include test('Includes recommended fonts and specified additional fonts') {

		@include oFonts($opts: (
			'recommended': true,
			'financier-display': (
				(weight: 'regular', style: normal)
			),
			'financier-text': (
				(weight: 'black', style: normal)
			)
		));

		// The font faces are output.
		// o-fonts keeps track of included fonts, we can't test font-faces
		// with true-sass so test against this private variable and reset
		// it for each test :mask:
		@include assert-equal(
			$_o-fonts-families-included,
			(
				'MetricWeb-regular-normal': true,
				'MetricWeb-semibold-normal': true,
				'FinancierDisplayWeb-medium-normal': true,
				'FinancierDisplayWeb-bold-normal': true,
				'FinancierDisplayWeb-regular-normal': true,
				'FinancierTextWeb-black-normal': true
			)
		);
		$_o-fonts-families-included: $original-o-fonts-families-included !global;
	}
}

@include test-module('oFontsVariantsIncluded') {
	$original-o-fonts-families-included: $_o-fonts-families-included;
	@include test('Marks default fonts as having been included when given no options') {

		@include oFontsVariantsIncluded();

		// The font faces are output.
		// o-fonts keeps track of included fonts, we can't test font-faces
		// with true-sass so test against this private variable and reset
		// it for each test :mask:
		@include assert-equal(
			$_o-fonts-families-included,
			(
				'MetricWeb-thin-normal': true,
				'MetricWeb-light-normal': true,
				'MetricWeb-light-italic': true,
				'MetricWeb-regular-normal': true,
				'MetricWeb-regular-italic': true,
				'MetricWeb-medium-normal': true,
				'MetricWeb-semibold-normal': true,
				'MetricWeb-bold-normal': true,
				'MetricWeb-bold-italic': true,
				'MetricWeb-black-normal': true,
				'FinancierDisplayWeb-light-normal': true,
				'FinancierDisplayWeb-light-italic': true,
				'FinancierDisplayWeb-regular-normal': true,
				'FinancierDisplayWeb-regular-italic': true,
				'FinancierDisplayWeb-medium-italic': true,
				'FinancierDisplayWeb-medium-normal': true,
				'FinancierDisplayWeb-semibold-normal': true,
				'FinancierDisplayWeb-semibold-italic': true,
				'FinancierDisplayWeb-bold-normal': true,
				'FinancierDisplayWeb-black-normal': true
			)
		);
		$_o-fonts-families-included: $original-o-fonts-families-included !global;
	}

	@include test('Marks recommended fonts as having been included only when "recommended" option given') {

		@include oFontsVariantsIncluded(('recommended': true));

		// The font faces are output.
		// o-fonts keeps track of included fonts, we can't test font-faces
		// with true-sass so test against this private variable and reset
		// it for each test :mask:
		@include assert-equal(
			$_o-fonts-families-included,
			(
				'MetricWeb-regular-normal': true,
				'MetricWeb-semibold-normal': true,
				'FinancierDisplayWeb-medium-normal': true,
				'FinancierDisplayWeb-bold-normal': true
			)
		);
		$_o-fonts-families-included: $original-o-fonts-families-included !global;
	}

	@include test('Marks recommended fonts as having been included and specified additional fonts') {

		@include oFontsVariantsIncluded($opts: (
			'recommended': true,
			'financier-display': (
				(weight: regular, style: normal)
			)
		));

		// The font faces are output.
		// o-fonts keeps track of included fonts, we can't test font-faces
		// with true-sass so test against this private variable and reset
		// it for each test :mask:
		@include assert-equal(
			$_o-fonts-families-included,
			(
				'MetricWeb-regular-normal': true,
				'MetricWeb-semibold-normal': true,
				'FinancierDisplayWeb-medium-normal': true,
				'FinancierDisplayWeb-bold-normal': true,
				'FinancierDisplayWeb-regular-normal': true
			)
		);
		$_o-fonts-families-included: $original-o-fonts-families-included !global;
	}
}

@include test-module('oFontsDefineCustomFont') {
	@include test('Outputs the custom font face and updates the "$_o-fonts-families" map.') {

		@include assert {
			// Include a custom font with regular and bold variants.
			@include output {
				@include oFontsDefineCustomFont('MyFont, sans', (
					(weight: regular, style: normal),
					(weight: bold, style: normal)
				)) {
					// True wraps this test in a class. We can't do that with font-face.
					// Instead test mixin content is output with arbitrary CSS.
					content: 'Just a test. Font face here.';
				}
			}
			@include expect {
				content: 'Just a test. Font face here.';
			}
		}

		// The custom font faces are recorded.
		@include assert-equal(
			$_o-fonts-families,
			("MyFont": ("font-family": "MyFont, sans", "variants": ((weight: regular, style: normal), (weight: bold, style: normal)), "custom": true), MetricWeb: (font-family: "MetricWeb, sans-serif", variants: ((weight: "thin", style: normal), (weight: "light", style: normal), (weight: "light", style: italic), (weight: "regular", style: normal), (weight: "regular", style: italic), (weight: "medium", style: normal), (weight: "semibold", style: normal), (weight: "bold", style: normal), (weight: "bold", style: italic), (weight: "black", style: normal))), FinancierDisplayWeb: (font-family: "FinancierDisplayWeb, serif", variants: ((weight: "light", style: normal), (weight: "light", style: italic), (weight: "regular", style: normal), (weight: "regular", style: italic), (weight: "medium", style: italic), (weight: "medium", style: normal), (weight: "semibold", style: normal), (weight: "semibold", style: italic), (weight: "bold", style: normal), (weight: "black", style: normal))), FinancierTextWeb: (font-family: "FinancierTextWeb, serif", variants: ((weight: "regular", style: italic), (weight: "regular", style: normal), (weight: "medium", style: normal), (weight: "bold", style: normal), (weight: "black", style: normal))))
		);
	}
}
