2019-03-13 04:14:30 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2022-01-26 01:23:18 -08:00
|
|
|
"oh-my-posh/mock"
|
2022-01-26 04:53:35 -08:00
|
|
|
"oh-my-posh/properties"
|
2019-03-13 04:14:30 -07:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2020-11-04 23:56:12 -08:00
|
|
|
func TestSpotifyStringPlayingSong(t *testing.T) {
|
|
|
|
expected := "\ue602 Candlemass - Spellbreaker"
|
2022-01-26 01:23:18 -08:00
|
|
|
env := new(mock.MockedEnvironment)
|
2022-01-26 05:10:18 -08:00
|
|
|
s := &Spotify{
|
2022-01-22 10:46:56 -08:00
|
|
|
MusicPlayer: MusicPlayer{
|
|
|
|
Artist: "Candlemass",
|
|
|
|
Track: "Spellbreaker",
|
|
|
|
Status: "playing",
|
|
|
|
Icon: "\ue602 ",
|
|
|
|
},
|
2022-01-26 04:53:35 -08:00
|
|
|
props: properties.Map{},
|
2022-01-22 10:46:56 -08:00
|
|
|
env: env,
|
2020-11-04 23:56:12 -08:00
|
|
|
}
|
2022-01-26 05:26:56 -08:00
|
|
|
assert.Equal(t, expected, renderTemplate(env, s.Template(), s))
|
2020-11-04 23:56:12 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestSpotifyStringStoppedSong(t *testing.T) {
|
|
|
|
expected := "\uf04d "
|
2022-01-26 01:23:18 -08:00
|
|
|
env := new(mock.MockedEnvironment)
|
2022-01-26 05:10:18 -08:00
|
|
|
s := &Spotify{
|
2022-01-22 10:46:56 -08:00
|
|
|
MusicPlayer: MusicPlayer{
|
|
|
|
Artist: "Candlemass",
|
|
|
|
Track: "Spellbreaker",
|
|
|
|
Status: "stopped",
|
|
|
|
Icon: "\uf04d ",
|
|
|
|
},
|
2022-01-26 04:53:35 -08:00
|
|
|
props: properties.Map{},
|
2022-01-22 10:46:56 -08:00
|
|
|
env: env,
|
2020-11-04 23:56:12 -08:00
|
|
|
}
|
2022-01-26 05:26:56 -08:00
|
|
|
assert.Equal(t, expected, renderTemplate(env, s.Template(), s))
|
2019-03-13 04:14:30 -07:00
|
|
|
}
|