From d1967b4402691ddff7196294c04d96d2b96f05c4 Mon Sep 17 00:00:00 2001 From: StarFleetCPTN Date: Thu, 13 Mar 2025 19:02:02 -0700 Subject: [PATCH] feat: Add comprehensive tests for providers and scheduler functionalities - Introduce new test file for providers, covering integration and rendering of source and destination components - Implement tests for source and destination provider availability - Enhance scheduler tests with new scenarios for job unscheduling, log rotation, and file processing history - Add tests for output pattern processing with date and filename variables - Ensure accessibility and dynamic rendering of provider forms in tests --- components/providers/providers_test.go | 382 +++++++++++++++++ internal/scheduler/scheduler_test.go | 553 +++++++++++++++++++++++++ 2 files changed, 935 insertions(+) create mode 100644 components/providers/providers_test.go diff --git a/components/providers/providers_test.go b/components/providers/providers_test.go new file mode 100644 index 0000000..a670bea --- /dev/null +++ b/components/providers/providers_test.go @@ -0,0 +1,382 @@ +package providers + +import ( + "context" + "strings" + "testing" + + "github.com/starfleetcptn/gomft/components/providers/common" + "github.com/starfleetcptn/gomft/components/providers/destination" + "github.com/starfleetcptn/gomft/components/providers/source" + "github.com/stretchr/testify/assert" +) + +// Test that both source and destination providers can be rendered together with common components +func TestProvidersIntegration(t *testing.T) { + // Create context for test + ctx := context.Background() + assert := assert.New(t) + + // Test rendering common components + { + var buf strings.Builder + err := common.NameField().Render(ctx, &buf) + assert.NoError(err, "Failed to render NameField") + html := buf.String() + assert.Contains(html, `