]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix api tests + lint
authorPere Diaz Bou <pdiazbou@redhat.com>
Tue, 5 Jul 2022 12:57:16 +0000 (14:57 +0200)
committerPere Diaz Bou <pdiazbou@redhat.com>
Fri, 9 Sep 2022 17:30:24 +0000 (19:30 +0200)
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
(cherry picked from commit 08c980ede37f1d2eba08b43ce624994b939a3ca3)
(cherry picked from commit 065c9d4bd10aae24641b3905b060b8b2fc57bbc0)

Resolves: rhbz#2125432

qa/tasks/mgr/dashboard/test_rbd.py
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts

index 07d0f3cb961ce0ea2ea5b4de6813034f0152d404..5cd4ac209a93c075d2ae57a1591084e3408cf4c2 100644 (file)
@@ -13,7 +13,7 @@ class RbdTest(DashboardTestCase):
 
     @DashboardTestCase.RunAs('test', 'test', [{'rbd-image': ['create', 'update', 'delete']}])
     def test_read_access_permissions(self):
-        self._get('/api/block/image?offset=0&limit=5&search=&sort=%3Cname')
+        self._get('/api/block/image?offset=0&limit=-1&search=&sort=+name')
         self.assertStatus(403)
         self.get_image('pool', None, 'image')
         self.assertStatus(403)
@@ -284,7 +284,7 @@ class RbdTest(DashboardTestCase):
             self.fail("Snapshot {} not found".format(snap_name))
 
     def test_list(self):
-        data = self._view_cache_get('/api/block/image')
+        data = self._get('/api/block/image?offset=0&limit=-1&search=&sort=+name')
         self.assertStatus(200)
         self.assertEqual(len(data), 2)
 
index 9591f1ddb5feec7f33ed1511a0d298b630640c62..b4f82b2abbf19bbeaa346195f1b18d751772d06a 100644 (file)
@@ -797,8 +797,8 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
   changeSorting({ sorts }: any) {
     this.userConfig.sorts = sorts;
     if (this.serverSide) {
-                       this.userConfig.offset = 0;
-                       this.reloadData();
+      this.userConfig.offset = 0;
+      this.reloadData();
     }
   }