Skip to content

Commit

Permalink
test: rename describes
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuseduardomedeiros committed Dec 11, 2024
1 parent d5e641a commit 46fa532
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/services/api/resources/__tests__/profile.unit.spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { beforeEach, describe, vi } from 'vitest';
import apiService from '../profile';
import profileApi from '../profile';
import http from '@/services/api/http';
import { getProject, getToken } from '@/utils/config';

vi.mock('@/services/api/http');
vi.mock('@/utils/config');

describe('apiService', () => {
describe('Profile services', () => {
beforeEach(() => {
vi.clearAllMocks();
});
Expand All @@ -17,7 +17,7 @@ describe('apiService', () => {
http.get.mockResolvedValue(mockResponse);
getProject.mockReturnValue('project-uuid');

const result = await apiService.me();
const result = await profileApi.me();

expect(http.get).toHaveBeenCalledWith('/accounts/profile/', {
params: { project_uuid: 'project-uuid' },
Expand All @@ -32,7 +32,7 @@ describe('apiService', () => {
http.get.mockResolvedValue(mockResponse);
getProject.mockReturnValue('project-uuid');

const result = await apiService.onboarded();
const result = await profileApi.onboarded();

expect(http.get).toHaveBeenCalledWith(
'/permission/project/verify_access/',
Expand All @@ -47,7 +47,7 @@ describe('apiService', () => {
getProject.mockReturnValue('project-uuid');
http.patch.mockResolvedValue();

await apiService.onboard();
await profileApi.onboard();

expect(http.patch).toHaveBeenCalledWith(
'/permission/project/update_access/?project=project-uuid',
Expand All @@ -62,7 +62,7 @@ describe('apiService', () => {
getProject.mockReturnValue('project-uuid');
getToken.mockReturnValue('fake-token');

const result = await apiService.status();
const result = await profileApi.status();

expect(http.get).toHaveBeenCalledWith(
'/internal/permission/project/status/?project=project-uuid',
Expand All @@ -79,7 +79,7 @@ describe('apiService', () => {
const payload = { projectUuid: 'project-uuid', status: 'offline' };
http.post.mockResolvedValue();

await apiService.updateStatus(payload);
await profileApi.updateStatus(payload);

expect(http.post).toHaveBeenCalledWith(
'/internal/permission/project/status/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ beforeEach(() => {
getProject.mockReturnValue('mock-project-uuid');
});

describe('FlowsTringger', () => {
describe('FlowsTringger service', () => {
it('should get a list of contacts', async () => {
const mockResponse = { results: [], next: null };
http.get.mockResolvedValue({ data: mockResponse });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ vi.mock('@/utils/config', () => ({
getProject: vi.fn(() => 'mocked-project-id'),
}));

describe('queueService', () => {
describe('Queue service', () => {
describe('getListQueues', () => {
it('should make a GET request with correct params and return the response data', async () => {
const mockResponse = { data: [] };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ vi.mock('@/utils/config', () => ({

vi.mock('@/store/modules/profile');

describe('roomService', () => {
describe('Room service', () => {
describe('getAll', () => {
it('should make a GET request with correct params and return the response data', async () => {
const mockResponse = { data: [] };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ vi.mock('@/store/modules/chats/discussionMessages', () => ({
useDiscussionMessages: vi.fn(),
}));

describe('handleMessage', () => {
describe('Create discussion message service', () => {
let mockDiscussionStore,
mockDiscussionMessagesStore,
mockApp,
Expand Down

0 comments on commit 46fa532

Please sign in to comment.