Skip to content

Commit 3c1eb71

Browse files
authored
feat(Common): added lower case conversion for addButtonPosition (#100)
1 parent 0a071fa commit 3c1eb71

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/lib/kit/utils/__tests__/common.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ describe('kit/utils/common', () => {
9090
viewSpec: {layout: 'row'},
9191
});
9292

93+
expect(prepareSpec({viewSpec: {addButtonPosition: 'DOWN'}} as any)).toMatchObject({
94+
viewSpec: {addButtonPosition: 'down'},
95+
});
96+
9397
expect(prepareSpec({viewSpec: {themeLabel: 'WARNING'}} as any)).toMatchObject({
9498
viewSpec: {themeLabel: 'warning'},
9599
});

src/lib/kit/utils/common.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ export const prepareSpec = <Type extends Spec>(
9595
result.viewSpec.layout = result.viewSpec.layout.toLowerCase();
9696
}
9797

98+
if (_.isString(result.viewSpec?.addButtonPosition)) {
99+
result.viewSpec.addButtonPosition = result.viewSpec.addButtonPosition.toLowerCase();
100+
}
101+
98102
if (_.isString(result.viewSpec?.themeLabel)) {
99103
result.viewSpec.themeLabel = result.viewSpec.themeLabel.toLowerCase();
100104
}

0 commit comments

Comments
 (0)