Sha256: efd9d0ffc91701733e3acf7d9b9d8d04894da42bedb21e57d210d2f4dd4baa86

Contents?: true

Size: 1.7 KB

Versions: 3

Compression:

Stored size: 1.7 KB

Contents

/*
 * Get single value from key in instance map based on $selector::$key
 */
@include describe("[function] get-instance-value") {

	// $flint__instances: (
	// 	".instance::desktop": (
	// 		"instance-count": 1,
	// 		"parent-selector": none,
	// 		"key": "desktop",
	// 		"breakpoint": 80em,
	// 		"columns": 16,
	// 		"span": 4,
	// 		"context": null,
	// 		"gutter": null,
	// 		"internal": (
	// 			"width": 18.75em,
	// 			"margin-right": 0.625em,
	// 			"margin-left": 0.625em
	// 		)
	// 	)
	// );

	@include it("should expect to return false unless inside of a parent instance") {
		@include should(expect(
			flint-get-instance-value("desktop", "breakpoint")),
			to(be(false))
		);
	}

	.parent-instance {
		@include _("desktop", 4);

		.child-instance {
			@include _("desktop", 2) {

				@include it("should expect correct value from parent selector to be fetched from instance map") {
					@include should(expect(
						flint-get-instance-value("desktop", "breakpoint")),
						to(be(80em))
					);
					@include should(expect(
						flint-get-instance-value("desktop", "columns")),
						to(be(16))
					);
					@include should(expect(
						flint-get-instance-value("desktop", "span")),
						to(be(4))
					);
					@include should(expect(
						flint-get-instance-value("desktop", "internal", "width")),
						to(be(18.75em))
					);
				}

				@include it("should expect non-existent values to return false") {
					@include should(expect(
						flint-get-instance-value("mobile", "breakpoint")),
						to(be(false))
					);
					@include should(expect(
						flint-get-instance-value("laptop", "columns")),
						to(be(false))
					);
				}
			}
		}
	}

	$flint__instances: () !global;
	$flint__instance-count: 0 !global;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flint-gs-2.0.6 tests/input/functions/lib/_get-instance-value.scss
flint-gs-2.0.5 tests/input/functions/lib/_get-instance-value.scss
flint-gs-2.0.4 tests/input/functions/lib/_get-instance-value.scss