summaryrefslogtreecommitdiff
path: root/cell_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'cell_test.go')
-rw-r--r--cell_test.go22
1 files changed, 14 insertions, 8 deletions
diff --git a/cell_test.go b/cell_test.go
index 7598058..511078e 100644
--- a/cell_test.go
+++ b/cell_test.go
@@ -518,7 +518,7 @@ func TestSetCellFormula(t *testing.T) {
}
func TestGetCellRichText(t *testing.T) {
- f := NewFile()
+ f, theme := NewFile(), 1
runsSource := []RichTextRun{
{
@@ -527,13 +527,15 @@ func TestGetCellRichText(t *testing.T) {
{
Text: "b",
Font: &Font{
- Underline: "single",
- Color: "ff0000",
- Bold: true,
- Italic: true,
- Family: "Times New Roman",
- Size: 100,
- Strike: true,
+ Underline: "single",
+ Color: "ff0000",
+ ColorTheme: &theme,
+ ColorTint: 0.5,
+ Bold: true,
+ Italic: true,
+ Family: "Times New Roman",
+ Size: 100,
+ Strike: true,
},
},
}
@@ -580,6 +582,10 @@ func TestGetCellRichText(t *testing.T) {
// Test set cell rich text with illegal cell reference
_, err = f.GetCellRichText("Sheet1", "A")
assert.EqualError(t, err, newCellNameToCoordinatesError("A", newInvalidCellNameError("A")).Error())
+ // Test set rich text color theme without tint
+ assert.NoError(t, f.SetCellRichText("Sheet1", "A1", []RichTextRun{{Font: &Font{ColorTheme: &theme}}}))
+ // Test set rich text color tint without theme
+ assert.NoError(t, f.SetCellRichText("Sheet1", "A1", []RichTextRun{{Font: &Font{ColorTint: 0.5}}}))
}
func TestSetCellRichText(t *testing.T) {