Skip to content

Commit

Permalink
Add test for preserving layer visibility on offline editing
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 19, 2019
1 parent 7c52e65 commit 1858610
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/src/core/testqgsofflineediting.cpp
Expand Up @@ -152,6 +152,7 @@ void TestQgsOfflineEditing::createGeopackageAndSynchronizeBack()
//set on LayerTreeNode showFeatureCount property
QgsLayerTreeLayer *layerTreelayer = QgsProject::instance()->layerTreeRoot()->findLayer( mpLayer->id() );
layerTreelayer->setCustomProperty( QStringLiteral( "showFeatureCount" ), 1 );
layerTreelayer->setItemVisibilityChecked( false );

//convert
mOfflineEditing->convertToOfflineProject( offlineDataPath, offlineDbFile, layerIds, false, QgsOfflineEditing::GPKG );
Expand All @@ -164,6 +165,7 @@ void TestQgsOfflineEditing::createGeopackageAndSynchronizeBack()
//check LayerTreeNode showFeatureCount property
layerTreelayer = QgsProject::instance()->layerTreeRoot()->findLayer( mpLayer->id() );
QCOMPARE( layerTreelayer->customProperty( QStringLiteral( "showFeatureCount" ), 0 ).toInt(), 1 );
QCOMPARE( layerTreelayer->isVisible(), false );

QgsFeature firstFeatureInAction;
it = mpLayer->getFeatures();
Expand Down

0 comments on commit 1858610

Please sign in to comment.