Skip to content

Commit

Permalink
test: add set and get scene user data test
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzoddin committed Dec 1, 2023
1 parent 0ddd6de commit e50c7f6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions session/userdata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ func TestUserData(t *testing.T) {

assert.NotNil(userCurrentImage)
})

t.Run("set and get scene", func(t *testing.T) {
s := session.New()
userData := s.Get(2)

userData.SetScene(entities.SceneRenameImage)
scene := userData.GetScene()

assert.NotNil(scene)
assert.Equal(userData.CurrentQuestion, entities.QNewImageName)

userData.SetScene(entities.SceneRenameContainer)
scene = userData.GetScene()

assert.NotNil(scene)
assert.Equal(userData.CurrentQuestion, entities.QNewContainerName)
})
}

func newFakeContainers() []*entities.Container {
Expand Down

0 comments on commit e50c7f6

Please sign in to comment.