mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-23 17:11:08 -08:00
42 lines
879 B
Go
42 lines
879 B
Go
package segments
|
|
|
|
import (
|
|
"oh-my-posh/mock"
|
|
"oh-my-posh/properties"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestSpotifyStringPlayingSong(t *testing.T) {
|
|
expected := "\ue602 Candlemass - Spellbreaker"
|
|
env := new(mock.MockedEnvironment)
|
|
s := &Spotify{
|
|
MusicPlayer: MusicPlayer{
|
|
Artist: "Candlemass",
|
|
Track: "Spellbreaker",
|
|
Status: "playing",
|
|
Icon: "\ue602 ",
|
|
},
|
|
props: properties.Map{},
|
|
env: env,
|
|
}
|
|
assert.Equal(t, expected, renderTemplate(env, s.Template(), s))
|
|
}
|
|
|
|
func TestSpotifyStringStoppedSong(t *testing.T) {
|
|
expected := "\uf04d"
|
|
env := new(mock.MockedEnvironment)
|
|
s := &Spotify{
|
|
MusicPlayer: MusicPlayer{
|
|
Artist: "Candlemass",
|
|
Track: "Spellbreaker",
|
|
Status: "stopped",
|
|
Icon: "\uf04d ",
|
|
},
|
|
props: properties.Map{},
|
|
env: env,
|
|
}
|
|
assert.Equal(t, expected, renderTemplate(env, s.Template(), s))
|
|
}
|