github.com/web-platform-tests/wpt.fyi@v0.0.0-20240530210107-70cf978996f1/api/checks/summaries/actions_test.go (about)

     1  //go:build small
     2  // +build small
     3  
     4  // Copyright 2018 The WPT Dashboard Project. All rights reserved.
     5  // Use of this source code is governed by a BSD-style license that can be
     6  // found in the LICENSE file.
     7  
     8  package summaries
     9  
    10  import (
    11  	"testing"
    12  
    13  	"github.com/google/go-github/v47/github"
    14  	"github.com/stretchr/testify/assert"
    15  )
    16  
    17  // https://developer.github.com/v3/checks/runs/#actions-object
    18  func TestActionCharacterLimits(t *testing.T) {
    19  	actions := []*github.CheckRunAction{
    20  		RecomputeAction(),
    21  		IgnoreAction(),
    22  		CancelAction(),
    23  	}
    24  	for _, action := range actions {
    25  		assert.True(t, len(action.Identifier) <= 20, "Action %s's ID is too long", action.Identifier)
    26  		assert.True(t, len(action.Description) <= 40, "Action %s's desc is too long", action.Identifier)
    27  		assert.True(t, len(action.Label) <= 20, "Action %s's label is too long", action.Identifier)
    28  	}
    29  }