Page MenuHomePhabricator

Improve phpunit test coverage in Chart extension
Open, LowPublic

Description

Scenarios that we could cover in tests:

1a) valid tabular data and valid chart definition = both create successfully
1b) wikitext page can use the chart definition

{{#chart:Example.chart}}

1c) wikitext page can use chart definition with different valid data source

{{#chart:Example.chart|data=ValidTabularData.tab}}

1d) wikitext page saves successful with chart error box if

{{#chart:Example.chart|data=InvalidTabularData.tab}}

2a) invalid tabular data created via the page move situation, chart definition cannot be created when referencing this tabular data page source. status = not ok

3a) context: invalid tabular data created via the page move situation and invalid chart definition page also created via page move situation (valid chart definition but references invalid data source)
3b) wikitext page references the invalid chart definition and page renders with chart error

4a) context: valid tabular data created via the page move situation and invalid chart definition page also created via page move situation (chart definition has invalid json)
4b) wikitext page references the invalid chart definition and page renders with chart error