Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
6f3a10b
:test_tube: add playwright
thibaudbrault Mar 14, 2023
263b0c7
:white_check_mark: test can bypass authentification check
Mar 15, 2023
5a7ded4
:white_check_mark: test use fake user
Mar 15, 2023
6f00752
:white_check_mark: use fake information for code
Mar 15, 2023
8edc720
:bug: fix bug question not sent during test
Mar 16, 2023
15a2415
:white_check_mark: create multiple tests to check that the site is st…
thibaudbrault Mar 16, 2023
e8b3e6b
:white_check_mark: correct some tests + create token when laucnhing t…
Mar 17, 2023
9b46c27
:white_check_mark: tests use token and empty database before running
thibaudbrault Mar 20, 2023
2bd3eac
:test_tube: add algolia to tests + modif folder tructure for tests
Mar 22, 2023
15c4043
:pencil2: remove   in tips that were displayed on screen
Mar 22, 2023
2f31f62
:white_check_mark: tests with algolia work - text with tags do not
thibaudbrault Mar 24, 2023
d5c51ae
:white_check_mark: test pass except last one
thibaudbrault Mar 27, 2023
11ffb31
:white_check_mark: tests with tag filter work
thibaudbrault Mar 28, 2023
c0212eb
:white_check_mark: create user and fetch tags before running tests
Mar 30, 2023
935c6bb
:construction_worker: added test job in circleci config
thibaudbrault Mar 30, 2023
9d2a0d0
:green_heart: add install packages directory in test job
thibaudbrault Mar 30, 2023
137eecf
:green_heart: fix typo in circleci config
thibaudbrault Mar 30, 2023
999c0cc
:green_heart: fix problem with app-dir for test job
thibaudbrault Mar 30, 2023
e75953b
:white_check_mark: fix mistake in test 9
thibaudbrault Mar 30, 2023
9494b54
:memo: add docs page for testing
thibaudbrault Mar 30, 2023
d8154e9
:green_heart: add command in test job
thibaudbrault Mar 30, 2023
eea2b9a
:green_heart: add environment variables for new_service command
thibaudbrault Mar 30, 2023
a8af999
:card_file_box: modification datamodel to fix circleci errors
thibaudbrault Mar 30, 2023
2f77327
:green_heart: add step to check prisma version
thibaudbrault Mar 30, 2023
dc96264
:pencil2: fix typos in test page of the docs
Mar 31, 2023
03d0edc
:construction_worker: migrate prisma server from 1.20 to 1.34.10
thibaudbrault Apr 3, 2023
646591f
:green_heart: add environment variables fro test job
thibaudbrault Apr 3, 2023
68d5fca
:green_heart: add wait-on for command run new_service
thibaudbrault Apr 3, 2023
358d03b
:green_heart: make run new_service run in the background
thibaudbrault Apr 3, 2023
d620eac
:green_heart: add env variables to test command
thibaudbrault Apr 3, 2023
5f73092
:green_heart: remove background for run new_service
thibaudbrault Apr 3, 2023
079a47d
:white_check_mark: update tests to make them work
thibaudbrault Apr 4, 2023
a1319a9
:green_heart: add prisma management key to docker command in test job
thibaudbrault Apr 4, 2023
790e7cc
:green_heart: add name to some commands
thibaudbrault Apr 4, 2023
4ab5610
:green_heart: add wait-on for test command
thibaudbrault Apr 4, 2023
662bc53
:green_heart: remove background for new_service in test job
thibaudbrault Apr 4, 2023
47e340d
:green_heart: add background and changed prisma url
thibaudbrault Apr 4, 2023
bf4d11a
:green_heart: add step to install wait-on
thibaudbrault Apr 4, 2023
0208cec
:green_heart: remove background
thibaudbrault Apr 4, 2023
b133b7a
:green_heart: remove env variable for run local_containers
thibaudbrault Apr 4, 2023
2d79cef
:green_heart: remove a wait-on
thibaudbrault Apr 4, 2023
022ff1e
:green_heart: add wait-on
thibaudbrault Apr 4, 2023
07d718a
:green_heart: add background
thibaudbrault Apr 4, 2023
c0c095c
:green_heart: remove a wait-on
thibaudbrault Apr 4, 2023
0e8f4a6
:green_heart: change prisma url for test
thibaudbrault Apr 4, 2023
ef5eb8d
:green_heart: change again prisma url for test
thibaudbrault Apr 4, 2023
eb32ee5
:green_heart: change prisma url for test
thibaudbrault Apr 4, 2023
daf9813
:green_heart: install wait-on before using it
thibaudbrault Apr 4, 2023
0710346
:green_heart: add step to install wait-on
thibaudbrault Apr 4, 2023
8811ddc
:green_heart: remove background
thibaudbrault Apr 4, 2023
c9a25bb
:green_heart: add when to wait for completion of previous step to run…
thibaudbrault Apr 4, 2023
ddf2500
:white_check_mark: define algolia settings before launching the tests
Apr 5, 2023
a2e775f
:green_heart: add env variables to test command
Apr 5, 2023
c52d780
:green_heart: add wait for localhost:4466 to test command
Apr 5, 2023
bd069af
:green_heart: remove background
Apr 5, 2023
f20f50c
:green_heart: change localhost to 127.0.0.1
Apr 5, 2023
3002a51
:green_heart: remove when
Apr 5, 2023
1ceec86
:green_heart: change url for env variables
Apr 5, 2023
49b50c2
:green_heart: put back localhost
Apr 5, 2023
2527c01
:green_heart: remove background and a wait-on
Apr 5, 2023
a3eae1e
:green_heart: remove use of wait-on
Apr 5, 2023
1dd1c07
:green_heart: remove command wait-for-background
Apr 5, 2023
aad44c0
:green_heart: remove & at the end of commands
Apr 5, 2023
4894b80
:green_heart: add wait-on for create new service
Apr 5, 2023
3a6c4aa
:green_heart: add && in command for create new service
Apr 5, 2023
c6598c5
:green_heart: add background for create new service
Apr 5, 2023
2eb7537
:green_heart: add wait-on for test command
Apr 5, 2023
609bc84
:green_heart: remove background
Apr 5, 2023
cfd8d67
:green_heart: separate commands that use wait-on
Apr 5, 2023
e902f93
:green_heart: remove some wait-on
Apr 5, 2023
4d02aa1
:green_heart: add wait-for-it script
Apr 5, 2023
6e1b258
:green_heart: download wait-for-it script and give him access
Apr 5, 2023
98ba1a3
:green_heart: fuse multiple command into one multi-line command
Apr 5, 2023
535e02b
:green_heart: partially defuse multi-line command
Apr 5, 2023
5fce4d5
:green_heart: remove wait-for-it and put back wait-on
Apr 7, 2023
992adf7
:pencil2: fix typo in circleci config
Apr 7, 2023
cb63ee9
:green_heart: add background
Apr 7, 2023
1101b5f
:green_heart: change url and add second ait-on for test command
Apr 7, 2023
efa0cac
:green_heart: remove the change of the url
Apr 7, 2023
6e263aa
:green_heart: remove wait-on and add wait-port
Apr 7, 2023
1d2fbc4
:green_heart: remove http:// in wait-port ports
Apr 7, 2023
410a117
:green_heart: remove wait-port and add sleep
thibaudbrault Apr 11, 2023
1c231c2
:green_heart: add more time to sleep command
thibaudbrault Apr 11, 2023
d754ff0
:green_heart: remove and add wait-on
thibaudbrault Apr 11, 2023
1db0223
:green_heart: add logging to help debug
thibaudbrault Apr 11, 2023
0778739
:green_heart: add longer wait time for wait-on
thibaudbrault Apr 11, 2023
20ff51b
:green_heart: remove wait time and add echo
thibaudbrault Apr 11, 2023
ed69033
:green_heart: remove echo
thibaudbrault Apr 11, 2023
04c2b6f
:green_heart: move wait-on
thibaudbrault Apr 11, 2023
36964e2
:green_heart: put back wait-on
thibaudbrault Apr 11, 2023
a65d9b5
:green_heart: create new executor and remove local_containers command
thibaudbrault Apr 11, 2023
df03ca9
:green_heart: add algolia credentials
thibaudbrault Apr 11, 2023
ada08ae
:green_heart: install playwright browser before launching tests
thibaudbrault Apr 11, 2023
bfbc6ce
:green_heart: modify playwright install
thibaudbrault Apr 11, 2023
17206ff
:green_heart: add console log in test file
thibaudbrault Apr 11, 2023
a0f814d
:green_heart: add another console log in test
thibaudbrault Apr 11, 2023
5053d69
:green_heart: move console logs
thibaudbrault Apr 11, 2023
663bc96
:green_heart: move again console logs
thibaudbrault Apr 11, 2023
b738edb
:green_heart: move console logs
thibaudbrault Apr 11, 2023
46e0f78
:white_check_mark: add updateConfiguration mutation to create tags
thibaudbrault Apr 11, 2023
c844fb7
:white_check_mark: remove updateConfiguration mutation
thibaudbrault Apr 11, 2023
099efd1
:white_check_mark: add log in tagsIdQuery
thibaudbrault Apr 11, 2023
51d3569
:white_check_mark: add getConfig query
thibaudbrault Apr 11, 2023
40029d5
:white_check_mark: add log in getConfigQuery
thibaudbrault Apr 11, 2023
222d9b7
:white_check_mark: add mutations to create and delete configuration
thibaudbrault Apr 11, 2023
e251bd5
:white_check_mark: add log to see if the configuration is added
Apr 12, 2023
cc78b70
:white_check_mark: remove destructuration for some queries result
Apr 12, 2023
c92841c
:green_heart: change docker image for e2e-runner
Apr 12, 2023
023cfe9
:green_heart: add wait-on localhost:4000 for test command
Apr 12, 2023
52b20a8
:green_heart: remove playwright install
Apr 12, 2023
6105c34
:recycle: fix errors revealed by code review
Apr 12, 2023
e13317e
:recycle: automtically create a user to skip auth
Apr 12, 2023
6b7ffcc
:rotating_light: remove deprecated extends in .eslintrc in e2e folder
Apr 12, 2023
de87c42
:rotating_light: install babel-eslint in e2e
Apr 12, 2023
ae5736b
:heavy_minus_sign: remove deprecated eslint dependencies
Apr 12, 2023
f8d4315
:rotating_light: remove page.pause()
Apr 12, 2023
892256f
:loud_sound: add log in refrsehConfiguration
thibaudbrault Apr 13, 2023
95b2d0e
:loud_sound: add log after configuration creation
thibaudbrault Apr 13, 2023
9624d75
:loud_sound: add log in test file and after configuration query
thibaudbrault Apr 13, 2023
4203606
:white_check_mark: change the method used to create the configuration
thibaudbrault Apr 13, 2023
6fa0a15
:construction_worker: change playwright docker image version
thibaudbrault Apr 13, 2023
d44b21e
:green_heart: remove playwright docker image because of a node versio…
thibaudbrault Apr 13, 2023
cf052b5
:arrow_down: downgrade playwright dependency to 1.30.0 to use a compa…
thibaudbrault Apr 13, 2023
eb8bdc9
:green_heart: add playwright install command
thibaudbrault Apr 13, 2023
0be8798
:loud_sound: add logs in test file
thibaudbrault Apr 13, 2023
9f713d8
:loud_sound: move logs
thibaudbrault Apr 13, 2023
dc655c3
:loud_sound: add logs
thibaudbrault Apr 13, 2023
d48cbfc
:loud_sound: move a log
thibaudbrault Apr 13, 2023
f6e9431
:loud_sound: add multiple logs
thibaudbrault Apr 13, 2023
34ae230
:green_heart: add playwright install command
thibaudbrault Apr 13, 2023
e7ddaf1
:mute: remove logs in test file
thibaudbrault Apr 13, 2023
5c56682
:green_heart: add xvfb
thibaudbrault Apr 13, 2023
ae5dbe3
:wrench: add reporter for playwright tests
thibaudbrault Apr 13, 2023
c2fcb20
:green_heart: modify path to test results file
thibaudbrault Apr 13, 2023
84f2df5
:green_heart: add env variable to skip auth for test command
thibaudbrault Apr 14, 2023
e2d04c7
:white_check_mark: update test to log network requests
thibaudbrault Apr 14, 2023
4d6866d
:loud_sound: log page url at the start of the test
thibaudbrault Apr 14, 2023
8cc6dd1
:green_heart: add wait-on for test command
thibaudbrault Apr 14, 2023
516aded
:loud_sound: log user id
thibaudbrault Apr 14, 2023
515e81f
:white_check_mark: add waitForSelector
thibaudbrault Apr 14, 2023
837ce50
:white_check_mark: add timeout to waitForSelector
thibaudbrault Apr 14, 2023
c2bb89c
:white_check_mark: remove waitForSelector
thibaudbrault Apr 14, 2023
9f61525
:green_heart: add xvfb
thibaudbrault Apr 14, 2023
afd9ad8
:green_heart: modify command for xvfb
thibaudbrault Apr 14, 2023
7cc4a22
:green_heart: fix typo in command for xvfb
thibaudbrault Apr 14, 2023
32529ca
:mute: remove user id log and xvfb
thibaudbrault Apr 14, 2023
ca33b5e
:green_heart: add tracing for test
thibaudbrault Apr 14, 2023
8583bc9
:green_heart: modify method used for tracing test
thibaudbrault Apr 14, 2023
95c7cb2
:green_heart: modify path for tracing test
thibaudbrault Apr 14, 2023
c64a01f
:green_heart: modify path for tracing test
thibaudbrault Apr 14, 2023
57d2a01
:white_check_mark: remove use of local storage in tests
thibaudbrault Apr 17, 2023
f360adb
:green_heart: change trace stored in artifact
thibaudbrault Apr 17, 2023
219683c
:green_heart: fix playwright config file
thibaudbrault Apr 17, 2023
0f80ccc
:mute: remove token log in test file
thibaudbrault Apr 17, 2023
7e38236
:white_check_mark: add timeout
thibaudbrault Apr 17, 2023
e9e62c6
:wrench: add longer timeout in playwright config
thibaudbrault Apr 18, 2023
75c21b6
:wrench: longer navigationTimeout
thibaudbrault Apr 18, 2023
3b1b9b9
:wrench: add longer test timeout
thibaudbrault Apr 18, 2023
cb5384c
:white_check_mark: remove goto login page
thibaudbrault Apr 18, 2023
fe76832
:white_check_mark: remove repeting functions and add baseUrl in confi…
thibaudbrault Apr 18, 2023
09fdf68
:white_check_mark: add screenshot and video to trace in CI
Apr 19, 2023
dabb1b9
:wrench: change path to store_artifacts and remove all timeout
Apr 19, 2023
1cb884d
:green_heart: add environment variables to test command
Apr 19, 2023
2f6dc27
:green_heart: remove algolia api key env variable
Apr 19, 2023
fa82c44
:rotating_light: fix lint errors for test file
Apr 19, 2023
c81d7ca
:rotating_light: format files in e2e folder
Apr 19, 2023
dd1aa6f
:arrow_down: downgrade prettier and pretty-quick in e2e folder
Apr 19, 2023
b82dd1e
:green_heart: add name to steps in test job
Apr 19, 2023
de189d0
:recycle: refactor creation of user when auth is disabled
Apr 19, 2023
a05ed35
:construction: add new tagCategories + field in prisma User type
Apr 19, 2023
50d84b1
:card_file_box: generate prisma schema with new user field
thibaudbrault Apr 20, 2023
b073788
:sparkles: possibility to access profile for users not connected
thibaudbrault Apr 20, 2023
7d561a1
:white_check_mark: add test to check the access to the user profile
thibaudbrault Apr 20, 2023
4c0ddad
:sparkles: add specialities block in profile + fix language switch in…
thibaudbrault Apr 20, 2023
2d3bac7
:rotating_light: remove focused test
thibaudbrault Apr 20, 2023
efa5e49
:pencil2: fix typo in failing test
thibaudbrault Apr 20, 2023
97d9372
:art: add specialities in userUpsert function
Apr 21, 2023
376a974
:construction: query to ftch a user's specialities
Apr 21, 2023
1ac66d1
:recycle: clean method used to show profile when not authentified
Apr 21, 2023
31894de
:card_file_box: add specialities field in type User and relation with…
thibaudbrault Apr 24, 2023
21a9442
:card_file_box: remove required user in TagLabel type
thibaudbrault Apr 24, 2023
190c081
:art: simplify specialities request
thibaudbrault Apr 24, 2023
655faed
:sparkles: show list of specialities for a user
thibaudbrault Apr 25, 2023
e97f991
:lipstick: usage of variables in css file
thibaudbrault Apr 25, 2023
f273c9a
:white_check_mark: change test to verify the existence of a speciality
Apr 26, 2023
d9010d9
:recycle: refactor code in test file
Apr 26, 2023
65af427
:twisted_rightwards_arrows: merge testPlaywrigt into userSpecialities
Apr 26, 2023
7df71e1
:recycle: modify code according to pr review
Apr 26, 2023
37b5023
:pencil2: fix spcialities to specialties
May 3, 2023
ae86aef
:pencil2: fix change name in file paths
May 3, 2023
454514b
:pencil2: fix last typos with specialities => specialties
May 3, 2023
211bd21
:pencil2: fix last typos with specialities => specialties again
May 3, 2023
3aa4f44
:rotating_light: remove isAuth from useMemo dependency array
May 3, 2023
900fc19
:pencil2: fix typos speciality => specialty
May 3, 2023
ff35f6e
:bug: fix crash when there was no specialty
May 3, 2023
3bdea59
Merge branch 'main' into userSpecialities
thibaudbrault May 3, 2023
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
8 changes: 5 additions & 3 deletions client/src/contexts/User/UserProvider.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react'
import { useQuery } from '@apollo/react-hooks'
import React, { useMemo } from 'react'

import { useAuth } from '../Auth'

Expand All @@ -10,9 +10,11 @@ export const UserContext = React.createContext({})
const UserProvider = ({ children }) => {
const { isAuth } = useAuth()

const { data } = useQuery(GET_ME, { skip: !isAuth })
const { data } = useQuery(GET_ME, {
skip: !isAuth && process.env.REACT_APP_DISABLE_AUTH !== 'true'
})

const value = useMemo(() => isAuth && data && data.me, [isAuth, data])
const value = useMemo(() => data && data.me, [data])

return <UserContext.Provider value={value}>{children}</UserContext.Provider>
}
Expand Down
6 changes: 4 additions & 2 deletions client/src/scenes/UserProfile/UserProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { alert, getIntl } from 'services'
import { Avatar, Button, Card, Modal, Loading, Input } from 'components'

import Logs from './components/Logs'
import Specialties from './components/Specialties'

import { UPDATE_INDENTITY, DELETE_IDENTITY } from './queries'

Expand Down Expand Up @@ -114,6 +115,7 @@ const UserProfile = ({ history }) => {
</Button>
</Card.Actions>
</Card>
<Specialties userId={user.id} />
<Logs userId={user.id} />
<Card>
<Card.Text>
Expand Down Expand Up @@ -167,7 +169,7 @@ const UserProfile = ({ history }) => {
}

UserProfile.translations = {
fr: {
en: {
alert: {
update_success: 'Your profile was successfully updated!',
delete_success: 'Your personal data was succesfully deleted!'
Expand Down Expand Up @@ -204,7 +206,7 @@ UserProfile.translations = {
button: 'I understand the consequences, delete my data'
}
},
en: {
fr: {
alert: {
update_success: 'Votre profil a été modifié avec succès !',
delete_success: 'Vos données personnelles ont été supprimées avec succès !'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { withRouter } from 'react-router'

import { withError, withPagination } from 'components'
import { compose, unserialize } from 'helpers'
import { query } from 'services/apollo'
import { withError, withPagination } from 'components'

import { meHistory } from './queries'

Expand Down
3 changes: 1 addition & 2 deletions client/src/scenes/UserProfile/components/Logs/Logs.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react'
import PropTypes from 'prop-types'
import { Link } from 'react-router-dom'

import { getIntl } from 'services'
import { formatHistoryAction, nodeUrl } from 'helpers'
import { getIntl } from 'services'

import { Loading } from 'components'
import Card, { CardText } from 'components/Card'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { withError } from 'components'
import { compose } from 'helpers'
import { query } from 'services/apollo'
import { GET_SPECIALTIES } from './queries'

import Specialties from './Specialties'

export default compose(
query(GET_SPECIALTIES, {
parse: ({ me = {} }) => ({
spe: me.specialties
})
}),
withError()
)(Specialties)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.specialty {
display: flex;
align-items: center;
justify-content: center;
width: fit-content;
padding: 0.3rem;
text-transform: capitalize;
background-color: transparent;
color: var(--primary-color);
border: 1px solid var(--primary-color);
border-radius: 4px;
}

.specialty .material-icons {
margin-right: 10px;
font-size: 1rem;
}

.emptyText {
text-align: center;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Card, { CardText } from 'components/Card'
import PropTypes from 'prop-types'
import { getIntl } from 'services'

import './Specialties.css'

const Specialties = ({ spe }) => {
const intl = getIntl(Specialties)

return (
<Card>
<CardText className="specialties">
<h2 style={{ marginBottom: '1rem' }}>{intl('title')}</h2>
<hr />
{spe && spe.length > 0 ? (
spe.map(s => (
<p key={s.name} className="specialty">
<i className="material-icons">verified</i>
{s.name}
</p>
))
) : (
<p className="emptyText">{intl('empty')}</p>
)}
</CardText>
</Card>
)
}

Specialties.propTypes = {
spe: PropTypes.array
}

Specialties.translations = {
en: {
title: 'Specialties',
empty: 'No specialties yet'
},
fr: {
title: 'Spécialitées',
empty: 'Pas encore de spécialitées'
}
}

export default Specialties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Specialties.container'
13 changes: 13 additions & 0 deletions client/src/scenes/UserProfile/components/Specialties/queries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import gql from 'graphql-tag'

export const GET_SPECIALTIES = gql`
query {
me {
id
specialties {
id
name
}
}
}
`
47 changes: 46 additions & 1 deletion e2e/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,42 @@ const upsertConfig = /* GraphQL */ `mutation UpsertConfig{
algoliaApiKey: "${process.env.ALGOLIA_API_KEY_ALL}"
auth0Domain: "${process.env.AUTH0_DOMAIN}"
auth0ClientId: "${process.env.AUTH0_CLIENT_ID}"
tagCategories: {create: [{name: "agencies", order: 1, labels: {create: [{ name: "paris", order: 1 }, { name: "nantes", order: 2 }]}}, {name: "theme", order: 2, labels: {create: [{name: "tutorial", order: 1}, {name: "meta", order: 2}]}}]}
tagCategories: {
create: [
{
name: "services",
order: 1,
labels: {
create: [
{name: "payroll", order: 1}
{name: "marketing", order: 2}
{name: "ce", order: 3}
{name: "sales", order: 4}
]
}
},
{
name: "agencies",
order: 2,
labels: {
create: [
{ name: "paris", order: 1 }
{ name: "nantes", order: 2 }
]
}
},
{
name: "theme",
order: 3,
labels: {
create: [
{ name: "tutorial", order: 1 },
{ name: "meta", order: 2 }
]
}
}
]
}
}
update: {
name: "${process.env.SERVICE_NAME}"
Expand Down Expand Up @@ -403,6 +438,16 @@ test('Should be able to search by text and tag', async ({ page }) => {
await expect(page.getByText('Ceci est une réponse différente', { exact: true })).toBeVisible()
})

test('Should see the marketing specialty on profile page', async ({ page }) => {
await page.goto('/')
await page.getByRole('img', { name: 'avatar' }).hover()
await page
.locator('a')
.filter({ hasText: 'Profil' })
.click()
await expect(page.getByText('verifiedmarketing')).toBeVisible()
})

test.afterEach(async () => {
algolia.clearIndex({ prisma })
})
Expand Down
2 changes: 2 additions & 0 deletions server/prisma/datamodel.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type TagLabel {

name: String!
tags: [Tag!]! @relation(name: "TagsLabel", onDelete: CASCADE)
specialists: [User!]! @relation(name: "UserSpecialties", link: TABLE)

order: Int!
category: TagCategory! @relation(name: "TagLabelsCategory", link: TABLE)
Expand Down Expand Up @@ -135,6 +136,7 @@ type User {

flags: [Flag!]! @relation(name: "UserFlags")
tags: [Tag!]! @relation(name: "UserTags")
specialties: [TagLabel!]! @relation(name: "UserSpecialties")

history: [HistoryAction!]! @relation(name: "UserHistoryActions")

Expand Down
18 changes: 15 additions & 3 deletions server/scripts/prisma_new_service/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,20 @@ const main = async () => {
tagCategories: {
create: [
{
name: "agencies"
order: 1
name: "services",
order: 1,
labels: {
create: [
{name: "payroll", order: 1}
{name: "marketing", order: 2}
{name: "ce", order: 3}
{name: "sales", order: 4}
]
}
},
{
name: "agencies",
order: 2,
labels: {
create: [
{ name: "paris", order: 1 }
Expand All @@ -75,7 +87,7 @@ const main = async () => {
},
{
name: "theme",
order: 2,
order: 3,
labels: {
create: [
{ name: "tutorial", order: 1 },
Expand Down
Loading