From eb7249871434b34768a2a56ee506fd27bd53dfa2 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Tue, 26 Oct 2021 10:26:53 -0700 Subject: [PATCH] tersify test assertions --- .../lib/layouts/preserve_layout.test.ts | 38 ++++++------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/x-pack/plugins/reporting/server/lib/layouts/preserve_layout.test.ts b/x-pack/plugins/reporting/server/lib/layouts/preserve_layout.test.ts index 16f889f591983..d78e877e526f5 100644 --- a/x-pack/plugins/reporting/server/lib/layouts/preserve_layout.test.ts +++ b/x-pack/plugins/reporting/server/lib/layouts/preserve_layout.test.ts @@ -9,23 +9,12 @@ import { PreserveLayout } from './preserve_layout'; it('preserve layout uses default layout selectors', () => { const testPreserveLayout = new PreserveLayout({ width: 16, height: 16 }); - expect(testPreserveLayout.getCssOverridesPath()).toMatch( - `x-pack/plugins/reporting/server/lib/layouts/preserve_layout.css` - ); - expect(testPreserveLayout.getBrowserViewport()).toMatchInlineSnapshot(` - Object { - "height": 32, - "width": 32, - } - `); - expect(testPreserveLayout.getBrowserZoom()).toMatchInlineSnapshot(`2`); - expect(testPreserveLayout.getPdfImageSize()).toMatchInlineSnapshot(` - Object { - "height": 16, - "width": 16, - } - `); - expect(testPreserveLayout.getPdfPageOrientation()).toMatchInlineSnapshot(`undefined`); + + expect(testPreserveLayout.getCssOverridesPath()).toMatch(`layouts/preserve_layout.css`); + expect(testPreserveLayout.getBrowserViewport()).toMatchObject({ height: 32, width: 32 }); + expect(testPreserveLayout.getBrowserZoom()).toBe(2); + expect(testPreserveLayout.getPdfImageSize()).toMatchObject({ height: 16, width: 16 }); + expect(testPreserveLayout.getPdfPageOrientation()).toBe(undefined); expect( testPreserveLayout.getPdfPageSize({ pageMarginTop: 27, @@ -35,13 +24,7 @@ it('preserve layout uses default layout selectors', () => { headingHeight: 82, subheadingHeight: 96, }) - ).toMatchInlineSnapshot(` - Object { - "height": 382, - "width": 176, - } - `); - + ).toMatchObject({ height: 382, width: 176 }); expect(testPreserveLayout.selectors).toMatchInlineSnapshot(` Object { "itemsCountAttribute": "data-shared-items-count", @@ -52,9 +35,9 @@ it('preserve layout uses default layout selectors', () => { "timefilterDurationAttribute": "data-shared-timefilter-duration", } `); - expect(testPreserveLayout.groupCount).toMatchInlineSnapshot(`1`); - expect(testPreserveLayout.height).toMatchInlineSnapshot(`16`); - expect(testPreserveLayout.width).toMatchInlineSnapshot(`16`); + expect(testPreserveLayout.groupCount).toBe(1); + expect(testPreserveLayout.height).toBe(16); + expect(testPreserveLayout.width).toBe(16); }); it('preserve layout allows customizable selectors', () => { @@ -62,6 +45,7 @@ it('preserve layout allows customizable selectors', () => { { width: 16, height: 16 }, { renderComplete: '[great-test-selectors]' } ); + expect(testPreserveLayout.selectors).toMatchInlineSnapshot(` Object { "itemsCountAttribute": "data-shared-items-count",