@@ -59,7 +59,7 @@ func TestVersion_RunWithEnv(t *testing.T) {
5959func TestVersion_RunWithPreview (t * testing.T ) {
6060 fs := afero .NewMemMapFs ()
6161 opts := & Opts {
62- basePath : "../../../test/data/base_spec_with_preview .json" ,
62+ basePath : "../../../test/data/base_spec_with_private_preview .json" ,
6363 outputPath : "foas.json" ,
6464 fs : fs ,
6565 env : "staging" ,
@@ -78,7 +78,7 @@ func TestVersion_RunWithPreview(t *testing.T) {
7878func TestVersion_RunStabilityLevelPreview (t * testing.T ) {
7979 fs := afero .NewMemMapFs ()
8080 opts := & Opts {
81- basePath : "../../../test/data/base_spec_with_preview .json" ,
81+ basePath : "../../../test/data/base_spec_with_private_preview .json" ,
8282 outputPath : "foas.json" ,
8383 fs : fs ,
8484 env : "staging" ,
@@ -92,13 +92,13 @@ func TestVersion_RunStabilityLevelPreview(t *testing.T) {
9292 // Check initial versions
9393 assert .NotEmpty (t , b )
9494 assert .NotContains (t , string (b ), "2023-02-01" )
95- assert .Contains (t , string (b ), "preview" )
95+ assert .Contains (t , string (b ), "private- preview" )
9696}
9797
9898func TestVersion_RunStabilityLevelStable (t * testing.T ) {
9999 fs := afero .NewMemMapFs ()
100100 opts := & Opts {
101- basePath : "../../../test/data/base_spec_with_preview .json" ,
101+ basePath : "../../../test/data/base_spec_with_private_preview .json" ,
102102 outputPath : "foas.json" ,
103103 fs : fs ,
104104 env : "staging" ,
@@ -112,5 +112,26 @@ func TestVersion_RunStabilityLevelStable(t *testing.T) {
112112 // Check initial versions
113113 assert .NotEmpty (t , b )
114114 assert .Contains (t , string (b ), "2023-02-01" )
115- assert .NotContains (t , string (b ), "preview" )
115+ assert .NotContains (t , string (b ), "private-review" )
116+ }
117+
118+ func TestVersion_PreviewAndPublicPreview (t * testing.T ) {
119+ fs := afero .NewMemMapFs ()
120+ opts := & Opts {
121+ basePath : "../../../test/data/base_spec_with_public_preview.json" ,
122+ outputPath : "foas.json" ,
123+ fs : fs ,
124+ env : "staging" ,
125+ stabilityLevel : "PREVIEW" ,
126+ }
127+
128+ require .NoError (t , opts .Run ())
129+ b , err := afero .ReadFile (fs , opts .outputPath )
130+ require .NoError (t , err )
131+
132+ // Check initial versions
133+ assert .NotEmpty (t , b )
134+ assert .Contains (t , string (b ), "2023-02-01" )
135+ assert .NotContains (t , string (b ), "private-preview" )
136+ assert .Contains (t , string (b ), "preview" )
116137}
0 commit comments