(t *testing.T)
| 110 | } |
| 111 | |
| 112 | func TestSlidesElementStyleShape(t *testing.T) { |
| 113 | dash := "DASH" |
| 114 | request := captureSlidesElementRequest(t, &SlidesElementStyleCmd{ |
| 115 | PresentationID: "pres1", |
| 116 | ObjectID: "shape1", |
| 117 | Kind: "shape", |
| 118 | FillColor: "#123", |
| 119 | OutlineColor: "#abcdef", |
| 120 | OutlineWeight: float64ElementTestPtr(2.5), |
| 121 | OutlineDash: &dash, |
| 122 | }, &RootFlags{Account: "a@b.com"}) |
| 123 | |
| 124 | update := request.UpdateShapeProperties |
| 125 | if update == nil || update.ObjectId != "shape1" { |
| 126 | t.Fatalf("unexpected shape style request: %+v", update) |
| 127 | } |
| 128 | for _, field := range []string{"shapeBackgroundFill.solidFill.color", "outline.outlineFill.solidFill.color", "outline.weight", "outline.dashStyle"} { |
| 129 | if !strings.Contains(update.Fields, field) { |
| 130 | t.Errorf("field mask %q missing %q", update.Fields, field) |
| 131 | } |
| 132 | } |
| 133 | fill := update.ShapeProperties.ShapeBackgroundFill.SolidFill |
| 134 | if fill.Color.RgbColor.Red != 1.0/15 || fill.Color.RgbColor.Green != 2.0/15 || fill.Color.RgbColor.Blue != 3.0/15 { |
| 135 | t.Fatalf("unexpected #123 expansion: %+v", fill.Color.RgbColor) |
| 136 | } |
| 137 | if update.ShapeProperties.Outline.Weight.Magnitude != 2.5 || update.ShapeProperties.Outline.DashStyle != "DASH" { |
| 138 | t.Fatalf("unexpected outline: %+v", update.ShapeProperties.Outline) |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | func TestSlidesElementStyleLineTransparent(t *testing.T) { |
| 143 | request := captureSlidesElementRequest(t, &SlidesElementStyleCmd{ |
nothing calls this directly
no test coverage detected