package app

import "testing"

func TestDefinitionIncludesCommunicationIntegrationSurface(t *testing.T) {
	surface := Definition().Surface
	menuFound := false
	for _, menu := range surface.Menus {
		if menu.Name == "integrationConfig" {
			menuFound = menu.ParentName == "extensions" && menu.Component == "view/systemTools/integration/config.vue"
			break
		}
	}
	if !menuFound {
		t.Fatal("communication integration menu is missing")
	}
	apiFound := false
	for _, api := range surface.APIs {
		if api.Method == "PUT" && api.Path == "/integration/configs/:kind/:provider" {
			apiFound = true
			break
		}
	}
	if !apiFound {
		t.Fatal("communication integration save API is missing")
	}
}
