Skip to content

Commit

Permalink
refactor: update preview note functions to use qualified imports
Browse files Browse the repository at this point in the history
  • Loading branch information
DariuszPorowski committed Jan 8, 2025
1 parent 333ed22 commit a546f6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions internal/pkg/fabricitem/data_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ import (
"testing"

"github.com/stretchr/testify/assert"

"github.com/microsoft/terraform-provider-fabric/internal/pkg/fabricitem"
)

func TestUnit_GetDataSourcePreviewNote_PreviewEnabled(t *testing.T) {
md := "This is a test data-source."
expected := md + "\n\n~> This data-source is in **preview**. To access it, you must explicitly enable the `preview` mode in the provider level configuration."
result := GetDataSourcePreviewNote(md, true)
result := fabricitem.GetDataSourcePreviewNote(md, true)

assert.Equal(t, expected, result)
}

func TestUnit_GetDataSourcePreviewNote_PreviewDisabled(t *testing.T) {
md := "This is a test data-source."
expected := md
result := GetDataSourcePreviewNote(md, false)
result := fabricitem.GetDataSourcePreviewNote(md, false)

assert.Equal(t, expected, result)
}
6 changes: 4 additions & 2 deletions internal/pkg/fabricitem/resource_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ import (
"testing"

"github.com/stretchr/testify/assert"

"github.com/microsoft/terraform-provider-fabric/internal/pkg/fabricitem"
)

func TestUnit_GetResourcePreviewNote_PreviewEnabled(t *testing.T) {
md := "This is a test resource."
expected := md + "\n\n~> This resource is in **preview**. To access it, you must explicitly enable the `preview` mode in the provider level configuration."
result := GetResourcePreviewNote(md, true)
result := fabricitem.GetResourcePreviewNote(md, true)

assert.Equal(t, expected, result)
}

func TestUnit_GetResourcePreviewNote_PreviewDisabled(t *testing.T) {
md := "This is a test resource."
expected := md
result := GetResourcePreviewNote(md, false)
result := fabricitem.GetResourcePreviewNote(md, false)

assert.Equal(t, expected, result)
}

0 comments on commit a546f6e

Please sign in to comment.