(t *testing.T)
| 128 | } |
| 129 | |
| 130 | func TestValidateCartesianMultiField(t *testing.T) { |
| 131 | rt, id := testruntime.NewInstanceWithOptions(t, testruntime.InstanceOptions{ |
| 132 | Files: metricsViewFiles(), |
| 133 | }) |
| 134 | |
| 135 | // Valid multi-field y. |
| 136 | testruntime.PutFiles(t, rt, id, map[string]string{ |
| 137 | "c1.yaml": ` |
| 138 | type: component |
| 139 | line_chart: |
| 140 | metrics_view: mv1 |
| 141 | x: |
| 142 | field: foo |
| 143 | y: |
| 144 | field: y |
| 145 | fields: |
| 146 | - y |
| 147 | - z |
| 148 | `}) |
| 149 | testruntime.ReconcileParserAndWait(t, rt, id) |
| 150 | testruntime.RequireReconcileState(t, rt, id, 4, 0, 0) |
| 151 | |
| 152 | // Invalid: one of the y.fields is a dimension. |
| 153 | testruntime.PutFiles(t, rt, id, map[string]string{ |
| 154 | "c1.yaml": ` |
| 155 | type: component |
| 156 | line_chart: |
| 157 | metrics_view: mv1 |
| 158 | x: |
| 159 | field: foo |
| 160 | y: |
| 161 | field: y |
| 162 | fields: |
| 163 | - y |
| 164 | - foo |
| 165 | `}) |
| 166 | testruntime.ReconcileParserAndWait(t, rt, id) |
| 167 | testruntime.RequireReconcileState(t, rt, id, 4, 1, 0) |
| 168 | testruntime.RequireReconcileErrorContains(t, rt, id, runtime.ResourceKindComponent, "c1", "is not a measure") |
| 169 | } |
| 170 | |
| 171 | func TestValidateCartesianColorField(t *testing.T) { |
| 172 | rt, id := testruntime.NewInstanceWithOptions(t, testruntime.InstanceOptions{ |
nothing calls this directly
no test coverage detected