@@ -109,5 +109,51 @@ public void RadzenPager_Renders_PagerDensityCompact()
109
109
110
110
Assert . Contains ( @$ "rz-density-compact", component . Markup ) ;
111
111
}
112
+
113
+ [ Fact ]
114
+ public async void RadzenPager_First_And_Prev_Buttons_Are_Disabled_When_On_The_First_Page ( )
115
+ {
116
+ using var ctx = new TestContext ( ) ;
117
+ ctx . JSInterop . Mode = JSRuntimeMode . Loose ;
118
+ ctx . JSInterop . SetupModule ( "_content/Radzen.Blazor/Radzen.Blazor.js" ) ;
119
+
120
+ var component = ctx . RenderComponent < RadzenPager > ( parameters => {
121
+ parameters . Add < int > ( p => p . PageSize , 10 ) ;
122
+ parameters . Add < int > ( p => p . Count , 100 ) ;
123
+ parameters . Add < bool > ( p => p . ShowPagingSummary , true ) ;
124
+ } ) ;
125
+
126
+ await component . Instance . GoToPage ( 0 ) ;
127
+ component . Render ( ) ;
128
+
129
+ var firstPageButton = component . Find ( "a.rz-pager-first" ) ;
130
+ Assert . True ( firstPageButton . HasAttribute ( "disabled" ) ) ;
131
+
132
+ var prevPageButton = component . Find ( "a.rz-pager-prev" ) ;
133
+ Assert . True ( prevPageButton . HasAttribute ( "disabled" ) ) ;
134
+ }
135
+
136
+ [ Fact ]
137
+ public async void RadzenPager_Last_And_Next_Buttons_Are_Disabled_When_On_The_Last_Page ( )
138
+ {
139
+ using var ctx = new TestContext ( ) ;
140
+ ctx . JSInterop . Mode = JSRuntimeMode . Loose ;
141
+ ctx . JSInterop . SetupModule ( "_content/Radzen.Blazor/Radzen.Blazor.js" ) ;
142
+
143
+ var component = ctx . RenderComponent < RadzenPager > ( parameters => {
144
+ parameters . Add < int > ( p => p . PageSize , 10 ) ;
145
+ parameters . Add < int > ( p => p . Count , 100 ) ;
146
+ parameters . Add < bool > ( p => p . ShowPagingSummary , true ) ;
147
+ } ) ;
148
+
149
+ await component . Instance . GoToPage ( 9 ) ;
150
+ component . Render ( ) ;
151
+
152
+ var lastPageButton = component . Find ( "a.rz-pager-last" ) ;
153
+ Assert . True ( lastPageButton . HasAttribute ( "disabled" ) ) ;
154
+
155
+ var nextPageButton = component . Find ( "a.rz-pager-next" ) ;
156
+ Assert . True ( nextPageButton . HasAttribute ( "disabled" ) ) ;
157
+ }
112
158
}
113
159
}
0 commit comments