Commit dde2e2bb authored by Kushal Pandya's avatar Kushal Pandya

GroupMemberContributions Service

parent f9a9e9a2
import axios from '~/lib/utils/axios_utils';
export default class GroupMemberService {
constructor(memberContributionsPath) {
this.memberContributionsPath = memberContributionsPath;
}
getContributedMembers() {
return axios.get(this.memberContributionsPath);
}
}
import axios from '~/lib/utils/axios_utils';
import GroupMemberService from 'ee/group_member_contributions/service/group_member_service';
import { contributionsPath } from '../mock_data';
describe('GroupMemberService', () => {
let service;
beforeEach(() => {
service = new GroupMemberService(contributionsPath);
});
describe('constructor', () => {
it('initializes default properties', () => {
expect(service.memberContributionsPath).toBe(contributionsPath);
});
});
describe('getContributedMembers', () => {
it('returns axios instance for memberContributionsPath', () => {
spyOn(axios, 'get').and.stub();
service.getContributedMembers();
expect(axios.get).toHaveBeenCalledWith(service.memberContributionsPath);
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment