Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[To Feature ] DESENG-605 - Adding Unit test #2518

Merged
merged 13 commits into from
May 22, 2024

Conversation

ratheesh-aot
Copy link
Collaborator

Issue #: https://apps.itsm.gov.bc.ca/jira/browse/DESENG-605

Description of changes:
Added unit test for Tenant listing and Tenant Detail page

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the met-public license (Apache 2.0).

@ratheesh-aot ratheesh-aot requested a review from NatSquared May 22, 2024 21:48
Copy link
Contributor

@NatSquared NatSquared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work here! Looks good; approved

@@ -188,6 +188,8 @@ const config: Config.InitialOptions = {

// Whether to use watchman for file crawling
// watchman: true,

testTimeout: 10000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were these tests timing out when running locally?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sometimes old tests also timing out locally

);

const loadingTexts = screen.getAllByText('Loading...');
expect(loadingTexts.length).toBeGreaterThan(0); // Adjust based on expected occurrences
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this left in intentionally?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

expect(screen.getByText('Contact One')).toBeVisible();
expect(screen.getByText('contactone@example.com')).toBeVisible();
expect(screen.getByText('Photographer One')).toBeVisible();
expect(screen.getByText('Logo Description One')).toBeVisible();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate how thorough these tests are :)

import * as reactRouter from 'react-router';
import * as tenantService from 'services/tenantService';
import TenantDetail from '../../../../src/components/tenantManagement/Detail';
import { MemoryRouter, Route, Routes, useParams } from 'react-router-dom';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed this unused import :p

Suggested change
import { MemoryRouter, Route, Routes, useParams } from 'react-router-dom';
import { MemoryRouter, Route, Routes} from 'react-router-dom';

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

import * as reactRedux from 'react-redux';
import * as reactRouter from 'react-router';
import * as tenantService from 'services/tenantService';
import { draftEngagement } from '../factory';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unused too 🙃

Suggested change
import { draftEngagement } from '../factory';

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ratheesh-aot ratheesh-aot merged commit 662729a into DESENG-605-TenantCRUDMain May 22, 2024
1 check passed
NatSquared added a commit that referenced this pull request May 24, 2024
* [To Feature Branch] - DESENG-605 - Tenant backend api (#2508)

* DESENG-605: Tenant API and Unit test

* DESENG-605 - Add Tenant - Frontend UI (#2510)

* DESENG-605 - Tenant detail page (#2511)

* DESENG-605: Tenant API and Unit test

* DESENG-605: Tenant detail page

* DESENG-606: Add tenant edit page (#2513)

* DESENG-605: Delete tenant flow

* DESENG-605 - Delete tenant functionality (#2515)

* DESENG-605 - Adding Unit test (#2518)

* DESENG-605: Tenant unit test for listing and detail

* Multi tenancy - UX Pass 1 (#2519)

* DESENG-605-606-unit-tests (#2522)

* Frontend unit tests

* Update changelog

---------

Co-authored-by: Ratheesh kumar R <ratheesh.kumar@aot-technologies.com>
@NatSquared NatSquared deleted the DESENG-605-TenantBackend branch June 26, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants