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

replace /members with /users #548

Merged
merged 15 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions __tests__/tasks/profile-picture.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const puppeteer = require('puppeteer');
const API_BASE_URL = 'https://staging-api.realdevsquad.com';
const { members } = require('../../mock-data/members');
const { allUsersData } = require('../../mock-data/users');

describe('Task Page - Assignee Profile Pic', () => {
let browser;
Expand All @@ -20,7 +20,7 @@ describe('Task Page - Assignee Profile Pic', () => {
page.on('request', (interceptedRequest) => {
const url = interceptedRequest.url();

if (url === `${API_BASE_URL}/members`) {
if (url === `${API_BASE_URL}/users`) {
interceptedRequest.respond({
status: 200,
contentType: 'application/json',
Expand All @@ -29,7 +29,7 @@ describe('Task Page - Assignee Profile Pic', () => {
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
},
body: JSON.stringify(members),
body: JSON.stringify(allUsersData),
});
} else {
interceptedRequest.continue();
Expand All @@ -52,7 +52,7 @@ describe('Task Page - Assignee Profile Pic', () => {

it('Profile picture with url', async () => {
const inputElement = await page.$('input#assignee');
const name = 'satyam';
const name = 'Arpit_02';

//Trigger the input event manually
for (let i = 0; i < name.length; i++) {
Expand All @@ -64,7 +64,7 @@ describe('Task Page - Assignee Profile Pic', () => {
await page.waitForTimeout(2000);
const imgSrc = await page.$eval('#list-items img', (img) => img.src);
const expectedImageFilename =
'https://res.cloudinary.com/imgprc/image/upload/v1688145505/profile/tu4zVmwFX91e9oEuSWLg/woqilcqdbp0cudcexkem.jpg';
'https://res.cloudinary.com/realdevsquad/image/upload/v1679878917/profile/54vObOfoscwiIVNMSqnN/askdcanhcehukqrdugge.jpg';
expect(imgSrc.endsWith(expectedImageFilename)).toBe(true);
});

Expand All @@ -75,7 +75,7 @@ describe('Task Page - Assignee Profile Pic', () => {
await page.keyboard.press('Backspace');
await new Promise((resolve) => setTimeout(resolve, 500));

const name = 'sumit';
const name = '19sriram';
for (let i = 0; i < name.length; i++) {
await inputElement.type(name[i], { delay: 100 });
}
Expand Down
2 changes: 1 addition & 1 deletion __tests__/tasks/task-dependency.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Input box', () => {
},
body: JSON.stringify(levels),
});
} else if (url === `${API_BASE_URL}/members`) {
} else if (url === `${API_BASE_URL}/users`) {
interceptedRequest.respond({
status: 200,
contentType: 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion online-members/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const TASKS_CLASS_LIST = ['task'];
const TASKS_CONTAINER_CLASS_LIST = ['tasks-container'];

// RDS Api Constants
const RDS_API_MEMBERS = API_BASE_URL + '/members';
const RDS_API_USERS = API_BASE_URL + '/users';
const RDS_API_TASKS_USERS = API_BASE_URL + '/tasks';
const RDS_CLOUDINARY_CLOUD_URL = `https://res.cloudinary.com/realdevsquad/image/upload`;

Expand Down
2 changes: 1 addition & 1 deletion online-members/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function getMembersData() {
const membersRequest = await makeApiCall(RDS_API_MEMBERS);
if (membersRequest.status === 200) {
membersList = await membersRequest.json();
membersList = membersList.members;
membersList = membersList.users;
membersList = membersList.filter((member) => !member.incompleteUserDetails);
membersList.forEach((member) => {
memberObject[`${member.username}`] = {
Expand Down
8 changes: 4 additions & 4 deletions task/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,19 +435,19 @@ async function fetchLevel() {
}
}

async function fetchMembers() {
async function fetchUsers() {
try {
const response = await fetch(`${API_BASE_URL}/members`);
const response = await fetch(`${API_BASE_URL}/users`);
const data = await response.json();
membersData = data.members;
membersData = data.users;
kotesh-arya marked this conversation as resolved.
Show resolved Hide resolved
} catch {
return;
}
}

fetchTags();
fetchLevel();
fetchMembers();
fetchUsers();

function filterMembers(searchInput) {
clearSuggestionList();
Expand Down
Loading