Skip to content

Commit

Permalink
Update faker function
Browse files Browse the repository at this point in the history
Since faker.datatype.uuid() is deprecated since v8.0.
  • Loading branch information
wlsf82 committed Jul 20, 2023
1 parent 1a6d165 commit bc58290
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/api/group/createGroup.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Group', () => {
before(() => cy.api_deleteGroups())

it('creates a group', () => {
const randomUuid = faker.datatype.uuid()
const randomUuid = faker.string.uuid()
const group = {
name: `group-${randomUuid}`,
path: randomUuid
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/api/project/createProject.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Project', () => {
before(() => cy.api_deleteProjects())

it('creates a project', () => {
const project = { name: `project-${faker.datatype.uuid()}` }
const project = { name: `project-${faker.string.uuid()}` }

cy.api_createProject(project)
.then(({ status, body }) => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/gui/group/createGroup.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Group', () => {

it('creates a group', () => {
const group = {
name: `group-${faker.datatype.uuid()}`,
name: `group-${faker.string.uuid()}`,
description: faker.random.words(5)
}

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/gui/group/createGroupLabel.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { faker } from '@faker-js/faker/locale/en'

describe('Group Label', () => {
const randomUuid = faker.datatype.uuid()
const randomUuid = faker.string.uuid()
const group = {
name: `group-${randomUuid}`,
path: randomUuid,
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/gui/group/removeGroup.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { faker } from '@faker-js/faker/locale/en'

describe('Group', () => {
const randomUuid = faker.datatype.uuid()
const randomUuid = faker.string.uuid()
const group = {
name: `group-${randomUuid}`,
path: randomUuid
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/gui/group/subGroup.cy.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { faker } from '@faker-js/faker/locale/en'

describe('Sub-group', () => {
const randomUuid = faker.datatype.uuid()
const randomUuid = faker.string.uuid()
const group = {
name: `group-${randomUuid}`,
path: randomUuid,
subgroup: {
name: `sub-group-${faker.datatype.uuid()}`
name: `sub-group-${faker.string.uuid()}`
}
}

Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/gui/project/createIssue.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { faker } from '@faker-js/faker/locale/en'

describe('Issue', () => {
const project = {
name: `project-${faker.datatype.uuid()}`,
name: `project-${faker.string.uuid()}`,
description: faker.random.words(5),
issue: {
title: `issue-${faker.datatype.uuid()}`,
title: `issue-${faker.string.uuid()}`,
description: faker.random.words(3)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/gui/project/createNewFile.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { faker } from '@faker-js/faker/locale/en'

describe('File', () => {
const project = {
name: `project-${faker.datatype.uuid()}`,
name: `project-${faker.string.uuid()}`,
file: {
name: `${faker.random.word()}.txt`,
content: faker.random.words(10)
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/gui/project/createProject.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Project', () => {

it('creates a project', () => {
const project = {
name: `project-${faker.datatype.uuid()}`,
name: `project-${faker.string.uuid()}`,
description: faker.random.words(5)
}

Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/gui/project/createProjectMilestone.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { faker } from '@faker-js/faker/locale/en'

describe('Projet Milestone', () => {
const project = {
name: `project-${faker.datatype.uuid()}`,
name: `project-${faker.string.uuid()}`,
milestone: {
title: `milestone-${faker.datatype.uuid()}`
title: `milestone-${faker.string.uuid()}`
}
}

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/gui/project/createWiki.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { faker } from '@faker-js/faker/locale/en'

describe('Wiki', () => {
const project = { name: `project-${faker.datatype.uuid()}` }
const project = { name: `project-${faker.string.uuid()}` }

beforeEach(() => {
cy.api_deleteProjects()
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands/api_commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ Cypress.Commands.add('api_deleteProjects', () => {

Cypress.Commands.add('api_createIssue', () => {
setAccessTokenIfNotYetSet()
cy.api_createProject({ name: `project-${faker.datatype.uuid()}` })
cy.api_createProject({ name: `project-${faker.string.uuid()}` })
.then(({ body }) => {
cy.request({
method: 'POST',
url: `/api/v4/projects/${body.id}/issues`,
headers: { 'Private-Token': accessToken },
body: { title: `issue-${faker.datatype.uuid()}` }
body: { title: `issue-${faker.string.uuid()}` }
})
})
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands/gui_commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Cypress.Commands.add('signup', (password = Cypress.env('user_password')) => {
cy.get('[data-qa-selector="change_password_button"]').click()
})

Cypress.Commands.add('gui_createAccessToken', (name = faker.datatype.uuid()) => {
Cypress.Commands.add('gui_createAccessToken', (name = faker.string.uuid()) => {
cy.visit('profile/personal_access_tokens')

cy.get('.qa-personal-access-token-name-field').type(name)
Expand Down

0 comments on commit bc58290

Please sign in to comment.