You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: node_fsm_test.go
    path of file: ./repos/chainlink/common/client
    
    the code of the file until where you have to start completion: package client

import (
	"slices"
	"strconv"
	"testing"

	"github.com/stretchr/testify/assert"

	"github.com/smartcontractkit/chainlink/v2/common/types"
)

type fnMock struct{ calls int }

func (fm *fnMock) Fn() {
	fm.calls++
}

func (fm *fnMock) AssertNotCalled(t *testing.T) {
	assert.Equal(t, 0, fm.calls)
}

func (fm *fnMock) AssertCalled(t *testing.T) {
    
func TestUnit_Node_StateTransitions(t *testing.T) {
	t.Parallel()

	t.Run("setState", func(t *testing.T) {
		n := newTestNode(t, testNodeOpts{rpc: nil, config: testNodeConfig{nodeIsSyncingEnabled: true}})
		assert.Equal(t, nodeStateUndialed, n.State())
		n.setState(nodeStateAlive)
		assert.Equal(t, nodeStateAlive, n.State())
		n.setState(nodeStateUndialed)
		assert.Equal(t, nodeStateUndialed, n.State())
	})

	t.Run("transitionToAlive", func(t *testing.T) {
		const destinationState = nodeStateAlive
		allowedStates := []nodeState{nodeStateDialed, nodeStateInvalidChainID, nodeStateSyncing}
		rpc := newMockNodeClient[types.ID, Head](t)
		testTransition(t, rpc, testNode.transitionToAlive, destinationState, allowedStates...)
	})

	t.Run("transitionToInSync", func(t *testing.T) {
		const destinationState = nodeStateAlive
		allowedStates := []nodeState{nodeStateOutOfSync, nodeStateSyncing}
		rpc := newMockNodeClient[types.ID, Head](t)
		testTransition(t, rpc, testNode.transitionToInSync, destinationState, allowedStates...)
	})
	t.Run("transitionToOutOfSync", func(t *testing.T) {
		const destinationState = nodeStateOutOfSync
		allowedStates := []nodeState{nodeStateAlive}
		rpc := newMockNodeClient[types.ID, Head](t)
		rpc.On("DisconnectAll").Once()
		testTransition(t, rpc, testNode.transitionToOutOfSync, destinationState, allowedStates...)
	})
	t.Run("transitionToUnreachable", func(t *testing.T) {
		const destinationState = nodeStateUnreachable
		allowedStates := []nodeState{nodeStateUndialed, nodeStateDialed, nodeStateAlive, nodeStateOutOfSync, nodeStateInvalidChainID, nodeStateSyncing}
		rpc := newMockNodeClient[types.ID, Head](t)
		rpc.On("DisconnectAll").Times(len(allowedStates))
		testTransition(t, rpc, testNode.transitionToUnreachable, destinationState, allowedStates...)
	})
	t.Run("transitionToInvalidChain", func(t *testing.T) {
		const destinationState = nodeStateInvalidChainID
		allowedStates := []nodeState{nodeStateDialed, nodeStateOutOfSync, nodeStateSyncing}
		rpc := newMockNodeClient[types.ID, Head](t)
		rpc.On("DisconnectAll").Times(len(allowedStates))
		testTransition(t, rpc, testNode.transitionToInvalidChainID, destinationState, allowedStates...)
	})
	t.Run("transitionToSyncing", func(t *testing.T) {
		const destinationState = nodeStateSyncing
		allowedStates := []nodeState{nodeStateDialed, nodeStateOutOfSync, nodeStateInvalidChainID}
		rpc := newMockNodeClient[types.ID, Head](t)
		rpc.On("DisconnectAll").Times(len(allowedStates))
		testTransition(t, rpc, testNode.transitionToSyncing, destinationState, allowedStates...)
	})
	t.Run("transitionToSyncing panics if nodeIsSyncing is disabled", func(t *testing.T) {
		rpc := newMockNodeClient[types.ID, Head](t)
		rpc.On("DisconnectAll").Once()
		node := newTestNode(t, testNodeOpts{rpc: rpc})
		node.setState(nodeStateDialed)
		fn := new(fnMock)
		defer fn.AssertNotCalled(t)
		assert.PanicsWithValue(t, "unexpected transition to nodeStateSyncing, while it's disabled", func() {
			node.transitionToSyncing(fn.Fn)
		})
	})
}