Unit tests: re-enable testing scaled UI

avoid using UI_SCALE_ENABLED = false because if this test is executed first, class UIScale does not register listeners to UIManager, which prevents updating user scale factor on font changes and testing scaled UI fails
This commit is contained in:
Karl Tauber
2022-01-03 16:52:43 +01:00
parent e5956900ea
commit db66a6c4f0
2 changed files with 3 additions and 3 deletions

View File

@@ -40,7 +40,7 @@ public class TestFlatStyleClasses
@BeforeAll
static void setup() {
System.setProperty( FlatSystemProperties.UI_SCALE_ENABLED, "false" );
System.setProperty( FlatSystemProperties.UI_SCALE, "1x" );
TestUtils.setup( false );
UIManager.put( "[style]Button.primary", BUTTON_PRIMARY );
@@ -100,7 +100,7 @@ public class TestFlatStyleClasses
@AfterAll
static void cleanup() {
TestUtils.cleanup();
System.clearProperty( FlatSystemProperties.UI_SCALE_ENABLED );
System.clearProperty( FlatSystemProperties.UI_SCALE );
}
@Test

View File

@@ -30,7 +30,7 @@ import com.formdev.flatlaf.FlatSystemProperties;
*/
public class TestUtils
{
public static final float[] FACTORS = new float[] { 1f }; //, 1.25f, 1.5f, 1.75f, 2f, 2.25f, 2.5f, 2.75f, 3f, 3.25f, 3.5f, 3.75f, 4f, 5f, 6f };
public static final float[] FACTORS = new float[] { 1f, 1.25f, 1.5f, 1.75f, 2f, 2.25f, 2.5f, 2.75f, 3f, 3.25f, 3.5f, 3.75f, 4f, 5f, 6f };
public static void setup( boolean withFocus ) {
System.setProperty( FlatSystemProperties.UI_SCALE, "1x" );