@@ -51,54 +51,38 @@ describe34("Manipulating views", function() {
5151 } ) ;
5252 describe ( "view.setProperties" , ( ) => {
5353 it ( "should change properties" , async ( ) => {
54+ const initial = await view . properties ( ) ;
55+ expect ( initial . cleanupIntervalStep ) . to . equal ( 10 ) ;
56+ expect ( initial . writebufferIdle ) . to . equal ( 64 ) ;
57+ const oldProps = await view . setProperties ( {
58+ cleanupIntervalStep : 20 ,
59+ writebufferIdle : 48
60+ } ) ;
61+ expect ( oldProps . cleanupIntervalStep ) . to . equal ( 20 ) ;
62+ expect ( oldProps . writebufferIdle ) . to . equal ( 48 ) ;
5463 const properties = await view . setProperties ( {
55- consolidationPolicy : {
56- type : "tier" ,
57- threshold : 0.123
58- }
64+ writebufferIdle : 32
5965 } ) ;
60- expect ( properties ) . to . have . property ( "name" , view . name ) ;
61- expect ( properties ) . to . have . property ( "links" ) ;
62- expect ( properties ) . to . have . property ( "consolidationPolicy" ) ;
63- expect ( properties . consolidationPolicy ) . to . have . property ( "type" , "tier" ) ;
64- expect ( properties . consolidationPolicy ) . to . have . property ( "threshold" ) ;
65- expect ( properties . consolidationPolicy . threshold . toFixed ( 3 ) ) . to . equal (
66- "0.123"
67- ) ;
66+ expect ( properties . cleanupIntervalStep ) . to . equal ( 20 ) ;
67+ expect ( properties . writebufferIdle ) . to . equal ( 32 ) ;
6868 } ) ;
6969 } ) ;
7070 describe ( "view.replaceProperties" , ( ) => {
7171 it ( "should change properties" , async ( ) => {
7272 const initial = await view . properties ( ) ;
73- expect ( initial . consolidationPolicy ) . to . have . property ( "threshold" ) ;
74- const oldProps = await view . replaceProperties ( {
75- consolidationPolicy : {
76- type : "bytes_accum" ,
77- threshold : 0.123
78- }
73+ expect ( initial . cleanupIntervalStep ) . to . equal ( 10 ) ;
74+ expect ( initial . writebufferIdle ) . to . equal ( 64 ) ;
75+ const oldProps = await view . setProperties ( {
76+ cleanupIntervalStep : 20 ,
77+ writebufferIdle : 48
7978 } ) ;
80- expect ( oldProps . consolidationPolicy ) . to . have . property ( "threshold" ) ;
81- expect ( oldProps . consolidationPolicy . threshold . toFixed ( 3 ) ) . to . equal (
82- "0.123"
83- ) ;
84- expect ( oldProps . consolidationPolicy ) . to . have . property (
85- "type" ,
86- "bytes_accum"
87- ) ;
88- const properties = await view . replaceProperties ( {
89- consolidationPolicy : {
90- type : "tier" ,
91- threshold : 0.456
92- }
79+ expect ( oldProps . cleanupIntervalStep ) . to . equal ( 20 ) ;
80+ expect ( oldProps . writebufferIdle ) . to . equal ( 48 ) ;
81+ const properties = await view . setProperties ( {
82+ writebufferIdle : 32
9383 } ) ;
94- expect ( properties ) . to . have . property ( "name" , view . name ) ;
95- expect ( properties ) . to . have . property ( "links" ) ;
96- expect ( properties ) . to . have . property ( "consolidationPolicy" ) ;
97- expect ( properties . consolidationPolicy ) . to . have . property ( "type" , "tier" ) ;
98- expect ( properties . consolidationPolicy ) . to . have . property ( "threshold" ) ;
99- expect ( properties . consolidationPolicy . threshold . toFixed ( 3 ) ) . to . equal (
100- "0.456"
101- ) ;
84+ expect ( properties . cleanupIntervalStep ) . to . equal ( 10 ) ;
85+ expect ( properties . writebufferIdle ) . to . equal ( 32 ) ;
10286 } ) ;
10387 } ) ;
10488 describe ( "view.rename" , ( ) => {
0 commit comments