Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CB-12250 CB-12409 iOS: Fix bug with escaping properties from plist file
- Loading branch information
1 parent
4c99c0d
commit 2f5a4df
Showing
3 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
var plistHelpers = require('../src/util/plist-helpers'); | ||
|
||
|
||
describe('prunePLIST', function() { | ||
var doc = { | ||
FirstConfigKey: { | ||
FirstPreferenceName: '*', | ||
SecondPreferenceName: 'a + b', | ||
ThirdPreferenceName: 'x-msauth-$(CFBundleIdentifier:rfc1034identifier)' | ||
}, | ||
|
||
SecondConfigKey: { | ||
FirstPreferenceName: 'abc' | ||
} | ||
}; | ||
|
||
var xml = '<dict>' + | ||
'<key>FirstPreferenceName</key>' + | ||
'<string>*</string>' + | ||
'<key>SecondPreferenceName</key>' + | ||
'<string>a + b</string>' + | ||
'<key>ThirdPreferenceName</key>' + | ||
'<string>x-msauth-$(CFBundleIdentifier:rfc1034identifier)</string>' + | ||
'</dict>'; | ||
|
||
var selector = 'FirstConfigKey'; | ||
|
||
it('Test 01: should remove property from plist file using provided selector', function(done) { | ||
var pruneStatus = plistHelpers.prunePLIST(doc, xml, selector); | ||
|
||
expect(pruneStatus).toBeTruthy(); | ||
expect(doc).toEqual( | ||
{ | ||
SecondConfigKey: { | ||
FirstPreferenceName: 'abc' | ||
} | ||
} | ||
); | ||
|
||
done(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters