]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: show correct RGW user 'system' info
authorAlfonso Martínez <almartin@redhat.com>
Tue, 11 Feb 2020 14:26:34 +0000 (15:26 +0100)
committerAlfonso Martínez <almartin@redhat.com>
Tue, 11 Feb 2020 14:26:34 +0000 (15:26 +0100)
Fixes: https://tracker.ceph.com/issues/44075
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts

index 573c53770624cb7ddd959f4509569befa0efd94a..54fff66f5a796f759a4d0c453506a55fecd2b0b1 100644 (file)
@@ -27,7 +27,7 @@
           <tr>
             <td i18n
                 class="bold">System</td>
-            <td>{{ user.system | booleanText }}</td>
+            <td>{{ user.system === 'true' | booleanText }}</td>
           </tr>
           <tr>
             <td i18n
index d5afbc5285a03707c73c44a2877342dbafbe5aa3..7f2cb633f0f9dfb174169eab5e526d4a16a9909b 100644 (file)
@@ -29,4 +29,24 @@ describe('RgwUserDetailsComponent', () => {
   it('should create', () => {
     expect(component).toBeTruthy();
   });
+
+  it('should show correct "System" info', () => {
+    component.selection.selected = [
+      { uid: '', email: '', system: 'true', keys: [], swift_keys: [] }
+    ];
+    component.ngOnChanges();
+    fixture.detectChanges();
+
+    const detailsTab = fixture.debugElement.nativeElement.querySelectorAll(
+      '.table.table-striped.table-bordered tr td'
+    );
+    expect(detailsTab[6].textContent).toEqual('System');
+    expect(detailsTab[7].textContent).toEqual('Yes');
+
+    component.selection.selected[0].system = 'false';
+    component.ngOnChanges();
+    fixture.detectChanges();
+
+    expect(detailsTab[7].textContent).toEqual('No');
+  });
 });