mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
feat(app/edge-stacks): summarize the edge stack statuses in the backend (#818)
This commit is contained in:
parent
363a62d885
commit
e1c480d3c3
21 changed files with 645 additions and 312 deletions
19
api/slicesx/flatten_test.go
Normal file
19
api/slicesx/flatten_test.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package slicesx_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/portainer/portainer/api/slicesx"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_Flatten(t *testing.T) {
|
||||
t.Run("Flatten an array of arrays", func(t *testing.T) {
|
||||
is := assert.New(t)
|
||||
|
||||
source := [][]int{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
|
||||
expected := []int{1, 2, 3, 4, 5, 6, 7, 8, 9}
|
||||
is.ElementsMatch(slicesx.Flatten(source), expected)
|
||||
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue