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

Create a test for pagination bar viewable in super admin #1233

Closed
ecurrencyhodler opened this issue Jan 2, 2024 · 16 comments
Closed

Create a test for pagination bar viewable in super admin #1233

ecurrencyhodler opened this issue Jan 2, 2024 · 16 comments
Assignees
Labels
bounties bug Something isn't working Posted

Comments

@ecurrencyhodler
Copy link
Contributor

ecurrencyhodler commented Jan 2, 2024

Create a component test to make sure pagination is visible

@ecurrencyhodler ecurrencyhodler added bug Something isn't working bounties Posted labels Jan 2, 2024
@ecurrencyhodler ecurrencyhodler added this to the Super Admin v1 milestone Jan 2, 2024
@hritikmunde
Copy link
Contributor

@ecurrencyhodler , Can I work on this?

@ecurrencyhodler
Copy link
Contributor Author

Yes absolutely. this is yours.

@ecurrencyhodler
Copy link
Contributor Author

Did you sign up on our website yet? If so, what's your profile? https://community.sphinx.chat/bounties

@ecurrencyhodler
Copy link
Contributor Author

Nvm found you!

@Vayras
Copy link
Contributor

Vayras commented Jan 3, 2024

@ecurrencyhodler I Think This has been already addressed , I corrected this work while working on #1223
A

@ecurrencyhodler
Copy link
Contributor Author

Okay. We can turn this bounty into a unit test then.

@ecurrencyhodler ecurrencyhodler changed the title Make pagination bar viewable in super admin Create a test for pagination bar viewable in super admin Jan 3, 2024
@ecurrencyhodler
Copy link
Contributor Author

@hritikmunde we are going to change this issue into a unit test only. Once #1223 has been merged, you can begin working on this bounty.

@hritikmunde
Copy link
Contributor

@ecurrencyhodler , okay got it.

@ecurrencyhodler
Copy link
Contributor Author

@hritikmunde this is now ready to be worked on. You can grab the latest from master.

@hritikmunde
Copy link
Contributor

@ecurrencyhodler , the tests for superAdmin are in the file TableComponent.Spec.tsx which has the wrong naming convention and is not in the folder __test__ which is where jest finds test cases according to the regex configured in file jest.config.js. To make a unit test for pagination I feel I should create a new file Pagination.spec.ts in the folder frontend\app\src\pages\superadmin\tableComponent\__test__ and add the test case there.

@kevkevinpal
Copy link
Contributor

@ecurrencyhodler , the tests for superAdmin are in the file TableComponent.Spec.tsx which has the wrong naming convention and is not in the folder __test__ which is where jest finds test cases according to the regex configured in file jest.config.js. To make a unit test for pagination I feel I should create a new file Pagination.spec.ts in the folder frontend\app\src\pages\superadmin\tableComponent\__test__ and add the test case there.

I'm not seeing any reference to the __test__ path in here https://github.com/stakwork/sphinx-tribes/blob/master/frontend/app/jest.config.json could you point out where exactly in the file it is pointing to that?

@hritikmunde
Copy link
Contributor

@ecurrencyhodler , the tests for superAdmin are in the file TableComponent.Spec.tsx which has the wrong naming convention and is not in the folder __test__ which is where jest finds test cases according to the regex configured in file jest.config.js. To make a unit test for pagination I feel I should create a new file Pagination.spec.ts in the folder frontend\app\src\pages\superadmin\tableComponent\__test__ and add the test case there.

I'm not seeing any reference to the __test__ path in here https://github.com/stakwork/sphinx-tribes/blob/master/frontend/app/jest.config.json could you point out where exactly in the file it is pointing to that?

I'm proposing to create a folder _test and create a new test file for pagination. What do you think?

hritikmunde added a commit to hritikmunde/sphinx-tribes that referenced this issue Jan 8, 2024
@kevkevinpal
Copy link
Contributor

@ecurrencyhodler , the tests for superAdmin are in the file TableComponent.Spec.tsx which has the wrong naming convention and is not in the folder __test__ which is where jest finds test cases according to the regex configured in file jest.config.js. To make a unit test for pagination I feel I should create a new file Pagination.spec.ts in the folder frontend\app\src\pages\superadmin\tableComponent\__test__ and add the test case there.

I realized you were right here, there seems to be a second jest.config.json file that specifies the __tests__ folder, I made some changes to move some tests into __tests__ folder

@kevkevinpal
Copy link
Contributor

@ecurrencyhodler , the tests for superAdmin are in the file TableComponent.Spec.tsx which has the wrong naming convention and is not in the folder __test__ which is where jest finds test cases according to the regex configured in file jest.config.js. To make a unit test for pagination I feel I should create a new file Pagination.spec.ts in the folder frontend\app\src\pages\superadmin\tableComponent\__test__ and add the test case there.

I'm not seeing any reference to the __test__ path in here https://github.com/stakwork/sphinx-tribes/blob/master/frontend/app/jest.config.json could you point out where exactly in the file it is pointing to that?

I'm proposing to create a folder _test and create a new test file for pagination. What do you think?

Yea I have considered that before but I think that it makes it easier to create and validate tests if they are closer to the files they test. Please read this post for the comparison to the two approaches but I think it is best practice to keep the tests near the code you are testing

@hritikmunde
Copy link
Contributor

@ecurrencyhodler , the tests for superAdmin are in the file TableComponent.Spec.tsx which has the wrong naming convention and is not in the folder __test__ which is where jest finds test cases according to the regex configured in file jest.config.js. To make a unit test for pagination I feel I should create a new file Pagination.spec.ts in the folder frontend\app\src\pages\superadmin\tableComponent\__test__ and add the test case there.

I realized you were right here, there seems to be a second jest.config.json file that specifies the __tests__ folder, I made some changes to move some tests into __tests__ folder

Yes I have added tests to that particular file. It's working will make changes needed in review

kevkevinpal added a commit that referenced this issue Jan 11, 2024
* #1236 Added Organization Users unit test

* Made changes for the mockFetch

* made prettier changes

* syntax and minor changes

* #1233 Added test to check pagination.

* Organization user conflict changes

* removed mocked css line in PaginationView test

* mock css added again

* Ignore CSS Imports in Jest Configuration

* added Alt text for pagination arrows

* separated two <h2> styled elements.

* mock data update

* date format updated

* <h2> child error changes

* added mock bounties

* changes

* test changes

* removed unnecessary files

* removed excessive mock data

* removed unncessary spaces

---------

Co-authored-by: kevkevin <oapallikunnel@gmail.com>
@ecurrencyhodler
Copy link
Contributor Author

Closed by #1288

elraphty pushed a commit that referenced this issue Jan 26, 2024
* #1236 Added Organization Users unit test

* Made changes for the mockFetch

* made prettier changes

* syntax and minor changes

* #1233 Added test to check pagination.

* Organization user conflict changes

* removed mocked css line in PaginationView test

* mock css added again

* Ignore CSS Imports in Jest Configuration

* added Alt text for pagination arrows

* separated two <h2> styled elements.

* mock data update

* date format updated

* <h2> child error changes

* added mock bounties

* changes

* test changes

* removed unnecessary files

* removed excessive mock data

* removed unncessary spaces

---------

Co-authored-by: kevkevin <oapallikunnel@gmail.com>
elraphty pushed a commit that referenced this issue Jan 26, 2024
* #1236 Added Organization Users unit test

* Made changes for the mockFetch

* made prettier changes

* syntax and minor changes

* #1233 Added test to check pagination.

* Organization user conflict changes

* removed mocked css line in PaginationView test

* mock css added again

* Ignore CSS Imports in Jest Configuration

* added Alt text for pagination arrows

* separated two <h2> styled elements.

* mock data update

* date format updated

* <h2> child error changes

* added mock bounties

* changes

* test changes

* removed unnecessary files

* removed excessive mock data

* removed unncessary spaces

---------

Co-authored-by: kevkevin <oapallikunnel@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounties bug Something isn't working Posted
Projects
Status: ✅ Done
Development

No branches or pull requests

4 participants