From a46e96fb12a04a9d855090a6f9ddc450817ae666 Mon Sep 17 00:00:00 2001 From: aryanshridhar Date: Wed, 5 Oct 2022 16:43:02 +0530 Subject: [PATCH] test: use snapshots to properly test version-select component --- .../version-select-spec.tsx.snap | 85 +++++++++++++++++++ .../components/version-select-spec.tsx | 6 +- 2 files changed, 87 insertions(+), 4 deletions(-) diff --git a/tests/renderer/components/__snapshots__/version-select-spec.tsx.snap b/tests/renderer/components/__snapshots__/version-select-spec.tsx.snap index 5b7f74bdbe..78c0af4827 100644 --- a/tests/renderer/components/__snapshots__/version-select-spec.tsx.snap +++ b/tests/renderer/components/__snapshots__/version-select-spec.tsx.snap @@ -1,5 +1,90 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`VersionSelect component disableDownload disables download buttons when return value is true 1`] = ` + + + +`; + +exports[`VersionSelect component disableDownload does not disable enabled download buttons when return value is false 1`] = ` +
  • + + + + 1.0.0 + + + Not downloaded + + +
  • +`; + exports[`VersionSelect component renderItem() renders an item 1`] = ` { })!; const ItemWrapper = shallow(item); - - expect(ItemWrapper.find('.disabled-menu-tooltip')).toHaveLength(1); + expect(ItemWrapper).toMatchSnapshot(); }); it('does not disable enabled download buttons when return value is false', () => { @@ -117,8 +116,7 @@ describe('VersionSelect component', () => { })!; const ItemWrapper = shallow(item); - - expect(ItemWrapper.exists('.disabled-menu-tooltip')).toBe(false); + expect(ItemWrapper).toMatchSnapshot(); }); });