feat(listview): set default view mode based on THUMBNAIL feature flag (#10691)

* feat(listview): set default view mode based on THUMBNAIL feature flag

* add spec

* better generic typing for ListView

* lint

* fix specs
This commit is contained in:
ʈᵃᵢ
2020-08-27 09:40:32 -07:00
committed by GitHub
parent bb92c1f84d
commit 81525c3e9d
8 changed files with 63 additions and 13 deletions

View File

@@ -20,6 +20,7 @@ import React from 'react';
import thunk from 'redux-thunk';
import configureStore from 'redux-mock-store';
import fetchMock from 'fetch-mock';
import * as featureFlags from 'src/featureFlags';
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
import { styledMount as mount } from 'spec/helpers/theming';
@@ -67,6 +68,14 @@ global.URL.createObjectURL = jest.fn();
fetchMock.get('/thumbnail', { body: new Blob(), sendAsJson: false });
describe('DashboardList', () => {
const isFeatureEnabledMock = jest
.spyOn(featureFlags, 'isFeatureEnabled')
.mockImplementation(feature => feature === 'THUMBNAILS');
afterAll(() => {
isFeatureEnabledMock.restore();
});
const mockedProps = {};
const wrapper = mount(<DashboardList {...mockedProps} />, {
context: { store },