theme_test.go 561 B

12345678910111213141516171819
  1. // Copyright 2017 Frédéric Guillot. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package model // import "miniflux.app/model"
  5. import "testing"
  6. func TestValidateTheme(t *testing.T) {
  7. for _, status := range []string{"default", "black", "sansserif"} {
  8. if err := ValidateTheme(status); err != nil {
  9. t.Error(`A valid theme should not generate any error`)
  10. }
  11. }
  12. if err := ValidateTheme("invalid"); err == nil {
  13. t.Error(`An invalid theme should generate a error`)
  14. }
  15. }