// SPDX-License-Identifier: LGPL-2.1-only
// Copyright (C) 2026 Liberux Labs, S. L. <info@liberux.net>

use super::*;

#[ test ]
fn default_thickness_and_pad_follow_the_mode()
{
	let s = separator();
	assert_eq!( s.thickness, None ); // None → follows the widget-scaling mode
	assert_eq!( s.pad_v,     None );
}

#[ test ]
fn explicit_zero_pad_v_is_flush_not_the_mode_default()
{
	// The Option repr lets `0.0` mean a real flush divider, distinct from
	// the mode-following default.
	let _g = crate::TEST_GLOBALS_LOCK.lock().unwrap_or_else( |e| e.into_inner() );
	let s = separator().pad_v( 0.0 );
	let canvas = crate::render::Canvas::new( 412, 900 );
	assert_eq!( s.preferred_size( 200.0, &canvas ).1, canvas.geom_px( theme::THICKNESS ) );
}

#[ test ]
fn preferred_height_includes_padding()
{
	let _g = crate::TEST_GLOBALS_LOCK.lock().unwrap_or_else( |e| e.into_inner() );
	let s = separator();
	let canvas = crate::render::Canvas::new( 412, 900 );
	let ( _, h ) = s.preferred_size( 200.0, &canvas );
	assert_eq!( h, canvas.geom_px( theme::THICKNESS ) + canvas.geom_px( theme::PAD_V ) * 2.0 );
}
