Skip to content

Commit 5a62029

Browse files
committedJul 27, 2017
Add tests
1 parent 497662a commit 5a62029

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎tests/src/gui/testqgsrelationreferencewidget.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,19 @@ void TestQgsRelationReferenceWidget::testChainFilter()
166166
// "material" == 'iron' AND "diameter" == '120' AND "raccord" = 'collar'
167167
}
168168
}
169+
170+
// set the filter for "raccord" and then reset filter for "diameter". As
171+
// chain filter is activated, the filter on "raccord" field should be reset
172+
cbs[2]->setCurrentIndex( cbs[2]->findText( "brides" ) );
173+
cbs[1]->setCurrentIndex( cbs[1]->findText( "diameter" ) );
174+
175+
// combobox should propose NULL, 10 and 11 because the filter is now:
176+
// "material" == 'iron'
177+
QCOMPARE( w.mComboBox->count(), 3 );
178+
179+
// if there's no filter at all, all features' id should be proposed
180+
cbs[0]->setCurrentIndex( cbs[0]->findText( "material" ) );
181+
QCOMPARE( w.mComboBox->count(), 4 );
169182
}
170183

171184
QGSTEST_MAIN( TestQgsRelationReferenceWidget )

0 commit comments

Comments
 (0)
Please sign in to comment.