@@ -558,7 +558,7 @@ func TestWidgetReadNotFound(t *testing.T) {
558558}
559559
560560func TestWidgetUpdate (t * testing.T ) {
561- sText := "text"
561+ sText := "new text"
562562
563563 d , err := qa.ResourceFixture {
564564 Fixtures : []qa.HTTPFixture {
@@ -589,12 +589,12 @@ func TestWidgetUpdate(t *testing.T) {
589589 json .RawMessage (`
590590 {
591591 "id": "12345",
592- "text": "text"
592+ "text": "new text"
593593 }
594594 ` ),
595595 json .RawMessage (`
596596 {
597- "id": "12345 ",
597+ "id": "12346 ",
598598 "visualization_id": null
599599 }
600600 ` ),
@@ -606,12 +606,12 @@ func TestWidgetUpdate(t *testing.T) {
606606 Update : true ,
607607 ID : "some-uuid/12345" ,
608608 InstanceState : map [string ]string {
609- "dashboard_id" : "some-uuid" ,
610- "visualization_id " : "678 " ,
609+ "dashboard_id" : "some-uuid" ,
610+ "text " : "previous text " ,
611611 },
612612 HCL : `
613613 dashboard_id = "some-uuid"
614- text = "text"
614+ text = "new text"
615615 ` ,
616616 }.Apply (t )
617617
@@ -620,17 +620,11 @@ func TestWidgetUpdate(t *testing.T) {
620620 assert .Equal (t , "some-uuid" , d .Get ("dashboard_id" ))
621621 assert .Equal (t , "12345" , d .Get ("widget_id" ))
622622
623- // Test that visualization_id is now unset (see instance state).
624- {
625- _ , ok := d .GetOk ("visualization_id" )
626- assert .False (t , ok , "visualization_id should not be set" )
627- }
628-
629623 // Test that text is now set.
630624 {
631625 v , ok := d .GetOk ("text" )
632626 assert .True (t , ok , "text should be set" )
633- assert .Equal (t , "text" , v )
627+ assert .Equal (t , "new text" , v )
634628 }
635629}
636630
0 commit comments