1- import { TaskLayoutOptions } from '../../src/Layout/TaskLayoutOptions' ;
1+ import { TaskLayoutComponent , TaskLayoutOptions } from '../../src/Layout/TaskLayoutOptions' ;
22
33describe ( 'TaskLayoutOptions' , ( ) => {
44 it ( 'should be constructable' , ( ) => {
@@ -26,25 +26,25 @@ describe('TaskLayoutOptions', () => {
2626 it ( 'should show fields by default' , ( ) => {
2727 const options = new TaskLayoutOptions ( ) ;
2828
29- expect ( options . isShown ( 'priority' ) ) . toEqual ( true ) ;
30- expect ( options . isShown ( 'createdDate' ) ) . toEqual ( true ) ;
29+ expect ( options . isShown ( TaskLayoutComponent . Priority ) ) . toEqual ( true ) ;
30+ expect ( options . isShown ( TaskLayoutComponent . CreatedDate ) ) . toEqual ( true ) ;
3131 } ) ;
3232
3333 it ( 'should be able to hide a field' , ( ) => {
3434 const options = new TaskLayoutOptions ( ) ;
35- options . hide ( 'createdDate' ) ;
35+ options . hide ( TaskLayoutComponent . CreatedDate ) ;
3636
37- expect ( options . isShown ( 'createdDate' ) ) . toEqual ( false ) ;
37+ expect ( options . isShown ( TaskLayoutComponent . CreatedDate ) ) . toEqual ( false ) ;
3838 } ) ;
3939
4040 it ( 'should be settable via a boolean' , ( ) => {
4141 const options = new TaskLayoutOptions ( ) ;
4242
43- options . setVisibility ( 'scheduledDate' , false ) ;
44- expect ( options . isShown ( 'scheduledDate' ) ) . toEqual ( false ) ;
43+ options . setVisibility ( TaskLayoutComponent . ScheduledDate , false ) ;
44+ expect ( options . isShown ( TaskLayoutComponent . ScheduledDate ) ) . toEqual ( false ) ;
4545
46- options . setVisibility ( 'scheduledDate' , true ) ;
47- expect ( options . isShown ( 'scheduledDate' ) ) . toEqual ( true ) ;
46+ options . setVisibility ( TaskLayoutComponent . ScheduledDate , true ) ;
47+ expect ( options . isShown ( TaskLayoutComponent . ScheduledDate ) ) . toEqual ( true ) ;
4848 } ) ;
4949
5050 it ( 'should set tag visibility' , ( ) => {
@@ -75,8 +75,8 @@ describe('TaskLayoutOptions', () => {
7575 blockLink"
7676 ` ) ;
7777
78- options . setVisibility ( 'dueDate' , false ) ;
79- options . setVisibility ( 'blockLink' , false ) ;
78+ options . setVisibility ( TaskLayoutComponent . DueDate , false ) ;
79+ options . setVisibility ( TaskLayoutComponent . BlockLink , false ) ;
8080
8181 expect ( options . shownComponents . join ( '\n' ) ) . toMatchInlineSnapshot ( `
8282 "description
@@ -96,8 +96,8 @@ describe('TaskLayoutOptions', () => {
9696 const options = new TaskLayoutOptions ( ) ;
9797 expect ( options . hiddenComponents . join ( '\n' ) ) . toMatchInlineSnapshot ( '""' ) ;
9898
99- options . setVisibility ( 'startDate' , false ) ;
100- options . setVisibility ( 'doneDate' , false ) ;
99+ options . setVisibility ( TaskLayoutComponent . StartDate , false ) ;
100+ options . setVisibility ( TaskLayoutComponent . DoneDate , false ) ;
101101
102102 expect ( options . hiddenComponents . join ( '\n' ) ) . toMatchInlineSnapshot ( `
103103 "startDate
@@ -108,26 +108,26 @@ describe('TaskLayoutOptions', () => {
108108 it ( 'should toggle visibility' , ( ) => {
109109 const options = new TaskLayoutOptions ( ) ;
110110
111- options . setVisibility ( 'cancelledDate' , false ) ;
112- options . setVisibility ( 'priority' , true ) ;
111+ options . setVisibility ( TaskLayoutComponent . CancelledDate , false ) ;
112+ options . setVisibility ( TaskLayoutComponent . Priority , true ) ;
113113 options . setTagsVisibility ( true ) ;
114114
115115 options . toggleVisibilityExceptDescriptionAndBlockLink ( ) ;
116116
117- expect ( options . isShown ( 'cancelledDate' ) ) . toEqual ( true ) ;
118- expect ( options . isShown ( 'priority' ) ) . toEqual ( false ) ;
117+ expect ( options . isShown ( TaskLayoutComponent . CancelledDate ) ) . toEqual ( true ) ;
118+ expect ( options . isShown ( TaskLayoutComponent . Priority ) ) . toEqual ( false ) ;
119119 expect ( options . areTagsShown ( ) ) . toEqual ( false ) ;
120120 } ) ;
121121
122122 it ( 'should not toggle visibility of description and blockLink' , ( ) => {
123123 const options = new TaskLayoutOptions ( ) ;
124- options . setVisibility ( 'description' , true ) ;
125- options . setVisibility ( 'blockLink' , true ) ;
124+ options . setVisibility ( TaskLayoutComponent . Description , true ) ;
125+ options . setVisibility ( TaskLayoutComponent . BlockLink , true ) ;
126126
127127 options . toggleVisibilityExceptDescriptionAndBlockLink ( ) ;
128128
129- expect ( options . isShown ( 'description' ) ) . toEqual ( true ) ;
130- expect ( options . isShown ( 'blockLink' ) ) . toEqual ( true ) ;
129+ expect ( options . isShown ( TaskLayoutComponent . Description ) ) . toEqual ( true ) ;
130+ expect ( options . isShown ( TaskLayoutComponent . BlockLink ) ) . toEqual ( true ) ;
131131 } ) ;
132132
133133 it ( 'should provide toggleable components' , ( ) => {
0 commit comments