@@ -28,11 +28,11 @@ func TestConvertToModel(t *testing.T) {
2828 assertion : require .Error ,
2929 cfg : DeclarativeConfig {
3030 Packages : []Package {newTestPackage ("foo" , "alpha" , svgSmallCircle )},
31- Bundles : []Bundle {newTestBundle ("bar" , "0.1.0" )},
31+ Bundles : []Bundle {newTestBundle ("bar" , "0.1.0" , withChannel ( "alpha" , "" ) )},
3232 },
3333 },
3434 {
35- name : "Error/FailedModelValidation " ,
35+ name : "Error/BundleMissingChannel " ,
3636 assertion : require .Error ,
3737 cfg : DeclarativeConfig {
3838 Packages : []Package {newTestPackage ("foo" , "alpha" , svgSmallCircle )},
@@ -47,6 +47,38 @@ func TestConvertToModel(t *testing.T) {
4747 Bundles : []Bundle {newTestBundle ("foo" , "0.1.0" , withChannel ("alpha" , "1" ), withChannel ("alpha" , "2" ))},
4848 },
4949 },
50+ {
51+ name : "Error/BundleMissingDefaultChannel" ,
52+ assertion : require .Error ,
53+ cfg : DeclarativeConfig {
54+ Packages : []Package {newTestPackage ("foo" , "" , svgSmallCircle )},
55+ Bundles : []Bundle {newTestBundle ("foo" , "0.1.0" , withChannel ("alpha" , "" ))},
56+ },
57+ },
58+ {
59+ name : "Error/BundleMissingImageAndData" ,
60+ assertion : require .Error ,
61+ cfg : DeclarativeConfig {
62+ Packages : []Package {newTestPackage ("foo" , "alpha" , svgSmallCircle )},
63+ Bundles : []Bundle {newTestBundle ("foo" , "0.1.0" , withChannel ("alpha" , "" ), withNoBundleImage (), withNoBundleData ())},
64+ },
65+ },
66+ {
67+ name : "NoError/BundleMissingProperties" ,
68+ assertion : require .Error ,
69+ cfg : DeclarativeConfig {
70+ Packages : []Package {newTestPackage ("foo" , "alpha" , svgSmallCircle )},
71+ Bundles : []Bundle {newTestBundle ("foo" , "0.1.0" , withChannel ("alpha" , "" ), withNoProperties ())},
72+ },
73+ },
74+ {
75+ name : "NoError/BundleWithDataButMissingImage" ,
76+ assertion : require .NoError ,
77+ cfg : DeclarativeConfig {
78+ Packages : []Package {newTestPackage ("foo" , "alpha" , svgSmallCircle )},
79+ Bundles : []Bundle {newTestBundle ("foo" , "0.1.0" , withChannel ("alpha" , "" ), withNoBundleImage ())},
80+ },
81+ },
5082 {
5183 name : "Success/ValidModel" ,
5284 assertion : require .NoError ,
0 commit comments