Skip to content

Commit

Permalink
Updated test #236
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Feb 22, 2024
1 parent b720bf0 commit 54a67f0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ModelJSTagLibSpec extends Specification implements TagLibUnitTest<ModelJST
tagLib.renderDataModelItem(ctx)

then:
actualOut.toString().trim() == 'data.myField = ko.observable().extend({numericString:2}).extend({metadata:{metadata:self.dataModel[\'myField\'], context:self.\$context, config:config}});'
actualOut.toString().trim() == 'data.myField = ko.observable().extend({numericString:{"decimalPlaces":2}}).extend({metadata:{metadata:self.dataModel[\'myField\'], context:self.\$context, config:config}});'
}

void "the feature data type doesn't need any special initialisation behaviour"() {
Expand Down Expand Up @@ -84,7 +84,7 @@ class ModelJSTagLibSpec extends Specification implements TagLibUnitTest<ModelJST
tagLib.numberViewModel(ctx)

then: "the default is 2"
actualOut.toString().trim() == "data.item1 = ko.observable().extend({numericString:2});"
actualOut.toString().trim() == "data.item1 = ko.observable().extend({numericString:{\"decimalPlaces\":2}});"

when: "a number of decimal places is specified"
ctx.dataModel.decimalPlaces = 3
Expand All @@ -93,7 +93,7 @@ class ModelJSTagLibSpec extends Specification implements TagLibUnitTest<ModelJST
tagLib.numberViewModel(ctx)

then:
actualOut.toString().trim() == "data.item1 = ko.observable().extend({numericString:3});"
actualOut.toString().trim() == "data.item1 = ko.observable().extend({numericString:{\"decimalPlaces\":3}});"

}

Expand Down

0 comments on commit 54a67f0

Please sign in to comment.