Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Jul 27, 2017
1 parent 497662a commit 5a62029
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/src/gui/testqgsrelationreferencewidget.cpp
Expand Up @@ -166,6 +166,19 @@ void TestQgsRelationReferenceWidget::testChainFilter()
// "material" == 'iron' AND "diameter" == '120' AND "raccord" = 'collar'
}
}

// set the filter for "raccord" and then reset filter for "diameter". As
// chain filter is activated, the filter on "raccord" field should be reset
cbs[2]->setCurrentIndex( cbs[2]->findText( "brides" ) );
cbs[1]->setCurrentIndex( cbs[1]->findText( "diameter" ) );

// combobox should propose NULL, 10 and 11 because the filter is now:
// "material" == 'iron'
QCOMPARE( w.mComboBox->count(), 3 );

// if there's no filter at all, all features' id should be proposed
cbs[0]->setCurrentIndex( cbs[0]->findText( "material" ) );
QCOMPARE( w.mComboBox->count(), 4 );
}

QGSTEST_MAIN( TestQgsRelationReferenceWidget )
Expand Down

0 comments on commit 5a62029

Please sign in to comment.