MCPcopy Create free account
hub / github.com/KDE/labplot / testStatisticsSpreadsheetToggle

Method testStatisticsSpreadsheetToggle

tests/spreadsheet/SpreadsheetTest.cpp:3161–3179  ·  view source on GitHub ↗

statistics spreadsheet ! * toggle on and off the statistics spreadsheet and check its presence */

Source from the content-addressed store, hash-verified

3159 * toggle on and off the statistics spreadsheet and check its presence
3160 */
3161void SpreadsheetTest::testStatisticsSpreadsheetToggle() {
3162 Project project;
3163 auto* sheet = new Spreadsheet(QStringLiteral("test"), false);
3164 project.addChild(sheet);
3165
3166 // initial
3167 auto children = sheet->children<StatisticsSpreadsheet>();
3168 QCOMPARE(children.size(), 0);
3169
3170 // toggle on
3171 sheet->toggleStatisticsSpreadsheet(true);
3172 children = sheet->children<StatisticsSpreadsheet>();
3173 QCOMPARE(children.size(), 1);
3174
3175 // toggle off
3176 sheet->toggleStatisticsSpreadsheet(false);
3177 children = sheet->children<StatisticsSpreadsheet>();
3178 QCOMPARE(children.size(), 0);
3179}
3180
3181/*!
3182 * change the statistics metrics and check the presense of the corresponding columns

Callers

nothing calls this directly

Calls 3

addChildMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected