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

Tests for task requests #407

Merged
merged 13 commits into from
Aug 24, 2023
Merged

Tests for task requests #407

merged 13 commits into from
Aug 24, 2023

Conversation

TanishqSingla
Copy link
Contributor

No description provided.


async function approveTaskRequest(userId) {
try {
console.error(taskRequestId, userId);

Check failure

Code scanning / CodeQL

Use of externally-controlled format string High

Format string depends on a
user-provided value
.
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 16, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 25d66d7
Status: ✅  Deploy successful!
Preview URL: https://8e05d9d5.dashboard-rds.pages.dev
Branch Preview URL: https://feature-task-request-ui.dashboard-rds.pages.dev

View logs

@TanishqSingla TanishqSingla changed the base branch from develop to feat/task-request-details July 20, 2023 17:19
@TanishqSingla TanishqSingla changed the base branch from feat/task-request-details to develop July 20, 2023 17:20
@TanishqSingla TanishqSingla marked this pull request as ready for review July 22, 2023 22:15
describe('When the user is super user', () => {
it('should display the task requests card', async () => {
const url = await page.evaluate(() => API_BASE_URL);
console.log(url);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove console.log

Comment on lines +49 to +54
const title = await taskCards[0].evaluate(
(el) => el.children[0].textContent,
);
const purpose = await taskCards[0].evaluate(
(el) => el.children[1].textContent,
);
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: By accessing children in this way, later if the HTML structure changes then the test will fail

Copy link
Member

@Achintya-Chatterjee Achintya-Chatterjee Aug 7, 2023

Choose a reason for hiding this comment

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

can I rewrite the code @prakashchoudhary07

Comment on lines +44 to +45
describe('When the user is super user', () => {
it('should display the task requests card', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

there should have been a test, to check if user is not super user

@Pratiyushkumar Pratiyushkumar self-assigned this Aug 5, 2023
@iamitprakash iamitprakash merged commit 25d66d7 into develop Aug 24, 2023
10 of 11 checks passed
@iamitprakash iamitprakash deleted the test/task-request-tests branch August 24, 2023 16:38
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.

5 participants