Project

General

Profile

Fix #42243

mgr/dashboard: Fix unit test that is failing in a negative timezone

Added by Stephan Müller about 1 month ago.

Status:
New
Priority:
Normal
Category:
dashboard/rbd
Target version:
-
Start date:
10/09/2019
Due date:
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

Found a test that is failing in a negative timezone (Washington (-05:00))

  ● RbdSnapshotListComponent › snapshot modal dialog › should display suggested snapshot name

    expect(received).toMatch(expected)

    Expected pattern: /^image01_[\d-]+T[\d.:]+\+[\d:]+$/
    Received string:  "image01_2019-10-09T03:40:18.664-05:00" 

      204 |     it('should display suggested snapshot name', () => {
      205 |       component.openCreateSnapshotModal();
    > 206 |       expect(component.modalRef.content.snapName).toMatch(
          |                                                   ^
      207 |         RegExp(`^${component.rbdName}_[\\d-]+T[\\d.:]+\\+[\\d:]+\$`)
      208 |       );
      209 |     });

      at src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts:206:51
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:391:26)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/dist/proxy.js:129:39)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:390:52)
      at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/dist/zone.js:150:43)
      at Object.testBody.length (node_modules/jest-preset-angular/zone-patch/index.js:52:27)

Also available in: Atom PDF