File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
test/unit/migrations/settings Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export default function migrate(settings) {
88 return settings ;
99 }
1010
11- if ( oldSetting ) {
11+ if ( typeof oldSetting === "string" ) {
1212 const newLinks = [ ] ;
1313
1414 oldSetting . split ( "|" ) . forEach ( ( link ) => {
Original file line number Diff line number Diff line change @@ -43,6 +43,21 @@ module(
4343 ) ;
4444 } ) ;
4545
46+ test ( "migrate when old setting value is an empty string" , function ( assert ) {
47+ const settings = new Map ( Object . entries ( { custom_header_links : "" } ) ) ;
48+
49+ const result = migrate ( settings ) ;
50+
51+ const expectedResult = new Map (
52+ Object . entries ( { custom_header_links : [ ] } )
53+ ) ;
54+
55+ assert . deepEqual (
56+ Object . fromEntries ( result . entries ( ) ) ,
57+ Object . fromEntries ( expectedResult . entries ( ) )
58+ ) ;
59+ } ) ;
60+
4661 test ( "migrate when old setting value is invalid" , function ( assert ) {
4762 const settings = new Map (
4863 Object . entries ( {
You can’t perform that action at this time.
0 commit comments