Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
  • Loading branch information
amsiglan committed Jun 4, 2024
1 parent c0aef57 commit d1f935b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ describe('AccelerationTable Component', () => {

it('renders without crashing', () => {
const wrapper = mount(
<AccelerationTable dataSourceName="testDataSource" cacheLoadingHooks={cacheLoadingHooks} />
<AccelerationTable
dataSourceName="testDataSource"
cacheLoadingHooks={cacheLoadingHooks}
dataSourceType="S3GLUE"
/>
);
expect(wrapper).toBeDefined();
});
Expand All @@ -111,7 +115,11 @@ describe('AccelerationTable Component', () => {
let wrapper: ReactWrapper;
await act(async () => {
wrapper = mount(
<AccelerationTable dataSourceName="testDataSource" cacheLoadingHooks={cacheLoadingHooks} />
<AccelerationTable
dataSourceName="testDataSource"
cacheLoadingHooks={cacheLoadingHooks}
dataSourceType="S3GLUE"
/>
);
});

Expand All @@ -132,7 +140,11 @@ describe('AccelerationTable Component', () => {
let wrapper: ReactWrapper;
await act(async () => {
wrapper = mount(
<AccelerationTable dataSourceName="testDataSource" cacheLoadingHooks={cacheLoadingHooks} />
<AccelerationTable
dataSourceName="testDataSource"
cacheLoadingHooks={cacheLoadingHooks}
dataSourceType="S3GLUE"
/>
);
});
wrapper!.update();
Expand All @@ -152,7 +164,11 @@ describe('AccelerationTable Component', () => {
let wrapper: ReactWrapper;
await act(async () => {
wrapper = mount(
<AccelerationTable dataSourceName="testDataSource" cacheLoadingHooks={cacheLoadingHooks} />
<AccelerationTable
dataSourceName="testDataSource"
cacheLoadingHooks={cacheLoadingHooks}
dataSourceType="S3GLUE"
/>
);
await new Promise((resolve) => setTimeout(resolve, 0));
wrapper!.update();
Expand All @@ -172,7 +188,11 @@ describe('AccelerationTable Component', () => {
let wrapper: ReactWrapper;
await act(async () => {
wrapper = mount(
<AccelerationTable dataSourceName="testDataSource" cacheLoadingHooks={cacheLoadingHooks} />
<AccelerationTable
dataSourceName="testDataSource"
cacheLoadingHooks={cacheLoadingHooks}
dataSourceType="S3GLUE"
/>
);
});
wrapper!.update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ describe('Create acceleration flyout components', () => {
coreStartMock.http.get = jest.fn().mockResolvedValue(mockDatasourcesQuery);

const wrapper = mount(
<CreateAcceleration selectedDatasource={selectedDatasource} resetFlyout={resetFlyout} />
<CreateAcceleration
selectedDatasource={selectedDatasource}
resetFlyout={resetFlyout}
selectedDatasourceType="S3GLUE"
/>
);
wrapper.update();
await waitFor(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ describe('Index type selector components', () => {
const wrapper = mount(
<IndexTypeSelector
accelerationFormData={accelerationFormData}
dataSourceType="S3GLUE"
setAccelerationFormData={setAccelerationFormData}
initiateColumnLoad={jest.fn()}
loading={false}
/>
);
wrapper.update();
Expand All @@ -46,9 +46,9 @@ describe('Index type selector components', () => {
const wrapper = mount(
<IndexTypeSelector
accelerationFormData={accelerationFormData}
dataSourceType="S3GLUE"
setAccelerationFormData={setAccelerationFormData}
initiateColumnLoad={jest.fn()}
loading={true}
/>
);
wrapper.update();
Expand Down

0 comments on commit d1f935b

Please sign in to comment.