From 134ceffd110ea070630c54ed9611dd82bf629622 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Thu, 2 Feb 2023 14:20:33 +0000 Subject: [PATCH] Testing to ensure column size calculated correctly --- tests/test_data_table.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/test_data_table.py b/tests/test_data_table.py index fccd4e275..80caf04ee 100644 --- a/tests/test_data_table.py +++ b/tests/test_data_table.py @@ -343,12 +343,16 @@ async def test_update_coordinate_coordinate_doesnt_exist(): @pytest.mark.parametrize( "label,new_value,new_content_width", [ - # We update the value of a cell to a value longer than the initial value, - # but shorter than the column label. The column label width should be used. + # Initial cell values are length 3. Let's update cell content and ensure + # that the width of the column is calculated given the new cell width. + # Shorter than initial cell value, larger than label => width remains same + ("A", "BB", 3), + # Larger than initial cell value, shorter than label => width remains that of label ("1234567", "1234", 7), - # We update the value of a cell to a value larger than the initial value, - # so the width of the column should be increased to accommodate on idle. - ("1234567", "123456789", 9), + # Shorter than initial cell value, shorter than label => width remains same + ("12345", "123", 5), + # Larger than initial cell value, larger than label => width updates to new cell value + ("12345", "123456789", 9), ], ) async def test_update_coordinate_column_width(label, new_value, new_content_width):