File indexing completed on 2024-12-22 04:14:02

0001 /*
0002  *  SPDX-License-Identifier: GPL-3.0-or-later
0003  */
0004 
0005 #include "TestSqueezedComboBox.h"
0006 #include <simpletest.h>
0007 
0008 #include <KisSqueezedComboBox.h>
0009 
0010 void TestSqueezedComboBox::testContains()
0011 {
0012     KisSqueezedComboBox *comboBox = new KisSqueezedComboBox();
0013 
0014     const int comboBoxWidth = 10;
0015     const int comboBoxHeight = 50;
0016 
0017     comboBox->resize(comboBoxWidth, comboBoxHeight);
0018 
0019     const QString testItemText("A test item name");
0020 
0021     comboBox->addSqueezedItem(testItemText);
0022 
0023     const int testItemIndex = 0;
0024     const QString squeezedItemText = comboBox->itemText(testItemIndex);
0025 
0026     Q_ASSERT(squeezedItemText != testItemText);
0027 
0028     QVERIFY(comboBox->contains(testItemText));
0029 }
0030 
0031 SIMPLE_TEST_MAIN(TestSqueezedComboBox)
0032