From 23420d2ef1f7246faa17f444d6da0265a1731c34 Mon Sep 17 00:00:00 2001 From: Geoffroy Begouaussel Date: Wed, 9 Oct 2024 17:49:40 +0200 Subject: [PATCH] feat(api): remove has-seen-level-seven-info usage --- api/db/database-builder/factory/build-user.js | 3 - api/src/evaluation/application/users/index.js | 25 ------- .../application/users/user-controller.js | 9 +-- ...remember-user-has-seen-level-seven-info.js | 5 -- .../repositories/user-repository.js | 13 +--- .../application/api/users-api.js | 4 -- .../domain/models/User.js | 3 - ...as-seen-level-seven-information.usecase.js | 13 ---- .../repositories/user.repository.js | 12 ---- .../jsonapi/user-with-activity.serializer.js | 1 - .../serializers/jsonapi/user-serializer.js | 1 - .../application/users/user-controller_test.js | 71 ------------------- .../application/users/user-controller_test.js | 29 -------- ...ber-user-has-seen-level-seven-info_test.js | 20 ------ .../application/user/user.route.test.js | 1 - .../application/api/users-api_test.js | 14 ---- .../unit/domain/models/User.test.js | 1 - ...en-level-seven-information.usecase.test.js | 21 ------ .../user-with-activity.serializer.test.js | 2 - .../jsonapi/user-serializer_test.js | 2 - .../database-builder/database-helpers_test.js | 2 +- 21 files changed, 4 insertions(+), 248 deletions(-) delete mode 100644 api/src/evaluation/domain/usecases/remember-user-has-seen-level-seven-info.js delete mode 100644 api/src/identity-access-management/domain/usecases/remember-user-has-seen-level-seven-information.usecase.js delete mode 100644 api/tests/evaluation/acceptance/application/users/user-controller_test.js delete mode 100644 api/tests/evaluation/unit/domain/usecases/remember-user-has-seen-level-seven-info_test.js delete mode 100644 api/tests/identity-access-management/unit/domain/usecases/remember-user-has-seen-level-seven-information.usecase.test.js diff --git a/api/db/database-builder/factory/build-user.js b/api/db/database-builder/factory/build-user.js index 6a6c555e6dc..63bb529a44e 100644 --- a/api/db/database-builder/factory/build-user.js +++ b/api/db/database-builder/factory/build-user.js @@ -74,7 +74,6 @@ function _generateEmailIfUndefined(email, id, lastName, firstName) { * @property {boolean} pixCertifTermsOfServiceAccepted * @property {boolean} hasSeenAssessmentInstructions * @property {boolean} hasSeenNewDashboardInfo - * @property {boolean} hasSeenLevelSevenInfo * @property {boolean} hasSeenFocusedChallengeTooltip * @property {boolean} hasSeenOtherChallengesTooltip * @property {boolean} isAnonymous @@ -102,7 +101,6 @@ const buildUser = function buildUser({ pixCertifTermsOfServiceAccepted = false, hasSeenAssessmentInstructions = false, hasSeenNewDashboardInfo = false, - hasSeenLevelSevenInfo = false, hasSeenFocusedChallengeTooltip = false, hasSeenOtherChallengesTooltip = false, isAnonymous = false, @@ -132,7 +130,6 @@ const buildUser = function buildUser({ pixCertifTermsOfServiceAccepted, hasSeenAssessmentInstructions, hasSeenNewDashboardInfo, - hasSeenLevelSevenInfo, hasSeenFocusedChallengeTooltip, hasSeenOtherChallengesTooltip, isAnonymous, diff --git a/api/src/evaluation/application/users/index.js b/api/src/evaluation/application/users/index.js index 1f1710e43f4..4c1b6e31b6e 100644 --- a/api/src/evaluation/application/users/index.js +++ b/api/src/evaluation/application/users/index.js @@ -6,31 +6,6 @@ import { userController } from './user-controller.js'; const register = async function (server) { server.route([ - { - method: 'PATCH', - path: '/api/users/{id}/user-has-seen-level-seven-info', - config: { - pre: [ - { - method: securityPreHandlers.checkRequestedUserIsAuthenticatedUser, - assign: 'requestedUserIsAuthenticatedUser', - }, - ], - validate: { - params: Joi.object({ - id: identifiersType.userId, - }), - }, - handler: userController.rememberUserHasSeenLevelSevenInfo, - notes: [ - '- **Cette route est restreinte aux utilisateurs authentifiés**\n' + - "- Sauvegarde le fait que l'utilisateur ait vu le message d'information d'ouverture du niveau 7" + - '- L’id demandé doit correspondre à celui de l’utilisateur authentifié', - "- Le contenu de la requête n'est pas pris en compte.", - ], - tags: ['api', 'user'], - }, - }, { method: 'PATCH', path: '/api/users/{id}/has-seen-new-dashboard-info', diff --git a/api/src/evaluation/application/users/user-controller.js b/api/src/evaluation/application/users/user-controller.js index 5d2b374906c..f0bb3bd8168 100644 --- a/api/src/evaluation/application/users/user-controller.js +++ b/api/src/evaluation/application/users/user-controller.js @@ -1,13 +1,6 @@ import * as userSerializer from '../../../shared/infrastructure/serializers/jsonapi/user-serializer.js'; import { evaluationUsecases as usecases } from '../../domain/usecases/index.js'; -const rememberUserHasSeenLevelSevenInfo = async function (request, h, dependencies = { userSerializer }) { - const authenticatedUserId = request.auth.credentials.userId; - - const updatedUser = await usecases.rememberUserHasSeenLevelSevenInfo({ userId: authenticatedUserId }); - return dependencies.userSerializer.serialize(updatedUser); -}; - const rememberUserHasSeenNewDashboardInfo = async function (request, h, dependencies = { userSerializer }) { const authenticatedUserId = request.auth.credentials.userId; @@ -15,6 +8,6 @@ const rememberUserHasSeenNewDashboardInfo = async function (request, h, dependen return dependencies.userSerializer.serialize(updatedUser); }; -const userController = { rememberUserHasSeenLevelSevenInfo, rememberUserHasSeenNewDashboardInfo }; +const userController = { rememberUserHasSeenNewDashboardInfo }; export { userController }; diff --git a/api/src/evaluation/domain/usecases/remember-user-has-seen-level-seven-info.js b/api/src/evaluation/domain/usecases/remember-user-has-seen-level-seven-info.js deleted file mode 100644 index d3d1f64c5bb..00000000000 --- a/api/src/evaluation/domain/usecases/remember-user-has-seen-level-seven-info.js +++ /dev/null @@ -1,5 +0,0 @@ -const rememberUserHasSeenLevelSevenInfo = function ({ userId, userRepository }) { - return userRepository.updateMarkLevelSevenInfoAsSeen({ userId }); -}; - -export { rememberUserHasSeenLevelSevenInfo }; diff --git a/api/src/evaluation/infrastructure/repositories/user-repository.js b/api/src/evaluation/infrastructure/repositories/user-repository.js index 06bd530c801..65815e9a4d7 100644 --- a/api/src/evaluation/infrastructure/repositories/user-repository.js +++ b/api/src/evaluation/infrastructure/repositories/user-repository.js @@ -1,16 +1,7 @@ /** - * @typedef {import ('./index.js').UserApi} UserApi + * @typedef {import ("./index.js").UserApi} UserApi */ -/** - * @function - * @param {Object} params - * @param {UserApi} params.userApi - */ -const updateMarkLevelSevenInfoAsSeen = async function ({ userId, userApi }) { - return userApi.markLevelSevenInfoAsSeen({ userId }); -}; - /** * @function * @param {Object} params @@ -21,4 +12,4 @@ const updateHasSeenNewDashboardInfo = async function ({ userId, userApi }) { return userApi.markNewDashboardInfoAsSeen({ userId }); }; -export { updateHasSeenNewDashboardInfo, updateMarkLevelSevenInfoAsSeen }; +export { updateHasSeenNewDashboardInfo }; diff --git a/api/src/identity-access-management/application/api/users-api.js b/api/src/identity-access-management/application/api/users-api.js index 69990d54c39..29b50386c2d 100644 --- a/api/src/identity-access-management/application/api/users-api.js +++ b/api/src/identity-access-management/application/api/users-api.js @@ -4,10 +4,6 @@ import { UserDTO } from './models/UserDTO.js'; * @module UserApi */ -export const markLevelSevenInfoAsSeen = async ({ userId }) => { - return usecases.rememberUserHasSeenLevelSevenInformation({ userId }); -}; - export const markNewDashboardInfoAsSeen = async ({ userId }) => { return usecases.markUserHasSeenNewDashboardInfo({ userId }); }; diff --git a/api/src/identity-access-management/domain/models/User.js b/api/src/identity-access-management/domain/models/User.js index f05b64cc746..a6b739a757d 100644 --- a/api/src/identity-access-management/domain/models/User.js +++ b/api/src/identity-access-management/domain/models/User.js @@ -29,7 +29,6 @@ class User { lastDataProtectionPolicySeenAt, hasSeenAssessmentInstructions, hasSeenNewDashboardInfo, - hasSeenLevelSevenInfo, hasSeenFocusedChallengeTooltip, hasSeenOtherChallengesTooltip, mustValidateTermsOfService, @@ -73,7 +72,6 @@ class User { this.hasSeenAssessmentInstructions = hasSeenAssessmentInstructions; this.hasSeenOtherChallengesTooltip = hasSeenOtherChallengesTooltip; this.hasSeenNewDashboardInfo = hasSeenNewDashboardInfo; - this.hasSeenLevelSevenInfo = hasSeenLevelSevenInfo; this.hasSeenFocusedChallengeTooltip = hasSeenFocusedChallengeTooltip; this.knowledgeElements = knowledgeElements; this.lang = lang ?? dependencies.languageService.LANGUAGES_CODE.FRENCH; @@ -189,7 +187,6 @@ class User { hasSeenAssessmentInstructions: this.hasSeenAssessmentInstructions, hasSeenOtherChallengesTooltip: this.hasSeenOtherChallengesTooltip, hasSeenNewDashboardInfo: this.hasSeenNewDashboardInfo, - hasSeenLevelSevenInfo: this.hasSeenLevelSevenInfo, hasSeenFocusedChallengeTooltip: this.hasSeenFocusedChallengeTooltip, lang: this.lang, locale: this.locale, diff --git a/api/src/identity-access-management/domain/usecases/remember-user-has-seen-level-seven-information.usecase.js b/api/src/identity-access-management/domain/usecases/remember-user-has-seen-level-seven-information.usecase.js deleted file mode 100644 index fbf381e5840..00000000000 --- a/api/src/identity-access-management/domain/usecases/remember-user-has-seen-level-seven-information.usecase.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @typedef {import ('../../domain/usecases/index.js').UserRepository} UserRepository - */ - -/** - * @param {Object} params - * @param {UserRepository} params.userRepository - */ -const rememberUserHasSeenLevelSevenInformation = function ({ userId, userRepository }) { - return userRepository.updateHasSeenLevelSevenInfoToTrue(userId); -}; - -export { rememberUserHasSeenLevelSevenInformation }; diff --git a/api/src/identity-access-management/infrastructure/repositories/user.repository.js b/api/src/identity-access-management/infrastructure/repositories/user.repository.js index d12cafd6ac3..1558f3e9907 100644 --- a/api/src/identity-access-management/infrastructure/repositories/user.repository.js +++ b/api/src/identity-access-management/infrastructure/repositories/user.repository.js @@ -296,16 +296,6 @@ const updateHasSeenAssessmentInstructionsToTrue = async function (id) { return new User(user); }; -const updateHasSeenLevelSevenInfoToTrue = async function (id) { - const now = new Date(); - const [user] = await knex('users') - .where({ id }) - .update({ hasSeenLevelSevenInfo: true, updatedAt: now }) - .returning('*'); - - return new User(user); -}; - const updateHasSeenNewDashboardInfoToTrue = async function (id) { const [user] = await knex('users') .where({ id }) @@ -447,7 +437,6 @@ const updateLastDataProtectionPolicySeenAt = async function ({ userId }) { * @property {function} updateEmail * @property {function} updateHasSeenAssessmentInstructionsToTrue * @property {function} updateHasSeenChallengeTooltip - * @property {function} updateHasSeenLevelSevenInfoToTrue * @property {function} updateHasSeenNewDashboardInfoToTrue * @property {function} updateLastDataProtectionPolicySeenAt * @property {function} updatePixCertifTermsOfServiceAcceptedToTrue @@ -480,7 +469,6 @@ export { updateEmail, updateHasSeenAssessmentInstructionsToTrue, updateHasSeenChallengeTooltip, - updateHasSeenLevelSevenInfoToTrue, updateHasSeenNewDashboardInfoToTrue, updateLastDataProtectionPolicySeenAt, updatePixCertifTermsOfServiceAcceptedToTrue, diff --git a/api/src/identity-access-management/infrastructure/serializers/jsonapi/user-with-activity.serializer.js b/api/src/identity-access-management/infrastructure/serializers/jsonapi/user-with-activity.serializer.js index a01d64770be..ebcb11e9746 100644 --- a/api/src/identity-access-management/infrastructure/serializers/jsonapi/user-with-activity.serializer.js +++ b/api/src/identity-access-management/infrastructure/serializers/jsonapi/user-with-activity.serializer.js @@ -22,7 +22,6 @@ const serialize = function (users, meta) { 'hasSeenAssessmentInstructions', 'isCertifiable', 'hasSeenNewDashboardInfo', - 'hasSeenLevelSevenInfo', 'hasSeenFocusedChallengeTooltip', 'hasSeenOtherChallengesTooltip', 'hasAssessmentParticipations', diff --git a/api/src/shared/infrastructure/serializers/jsonapi/user-serializer.js b/api/src/shared/infrastructure/serializers/jsonapi/user-serializer.js index 21721321e53..083f2e4f280 100644 --- a/api/src/shared/infrastructure/serializers/jsonapi/user-serializer.js +++ b/api/src/shared/infrastructure/serializers/jsonapi/user-serializer.js @@ -22,7 +22,6 @@ const serialize = function (users, meta) { 'profile', 'campaignParticipations', 'hasSeenAssessmentInstructions', - 'hasSeenLevelSevenInfo', 'isCertifiable', 'hasSeenNewDashboardInfo', 'hasSeenFocusedChallengeTooltip', diff --git a/api/tests/evaluation/acceptance/application/users/user-controller_test.js b/api/tests/evaluation/acceptance/application/users/user-controller_test.js deleted file mode 100644 index 7736dfc0a74..00000000000 --- a/api/tests/evaluation/acceptance/application/users/user-controller_test.js +++ /dev/null @@ -1,71 +0,0 @@ -import { - createServer, - databaseBuilder, - expect, - generateValidRequestAuthorizationHeader, -} from '../../../../test-helper.js'; - -describe('Acceptance | Route | Users ', function () { - let server; - let user; - let options; - - describe('PATCH /api/users/{id}/user-has-seen-level-seven-info', function () { - async function givenUserHasSeenLevelSevenInfo(hasSeenLevelSevenInfo) { - server = await createServer(); - - user = databaseBuilder.factory.buildUser({ hasSeenLevelSevenInfo }); - - options = { - method: 'PATCH', - url: `/api/users/${user.id}/user-has-seen-level-seven-info`, - headers: { authorization: generateValidRequestAuthorizationHeader(user.id) }, - }; - - await databaseBuilder.commit(); - } - - describe('Resource access management', function () { - beforeEach(async function () { - await givenUserHasSeenLevelSevenInfo(false); - }); - - it('should respond with a 401 - unauthorized access - if user is not authenticated', async function () { - options.headers.authorization = 'invalid.access.token'; - - const response = await server.inject(options); - - expect(response.statusCode).to.equal(401); - }); - - it('should respond with a 403 - forbidden access - if requested user is not the same as authenticated user', async function () { - const otherUserId = 9999; - options.headers.authorization = generateValidRequestAuthorizationHeader(otherUserId); - - const response = await server.inject(options); - - expect(response.statusCode).to.equal(403); - }); - }); - - describe('User has seen level seven info', function () { - it('should return the user with hasSeenLevelSevenInfo to true', async function () { - await givenUserHasSeenLevelSevenInfo(true); - - const response = await server.inject(options); - - expect(response.result.data.attributes['has-seen-level-seven-info']).to.be.true; - }); - }); - - describe('User has not seen level seven info', function () { - it('should return the user with hasSeenLevelSevenInfo to true', async function () { - await givenUserHasSeenLevelSevenInfo(false); - - const response = await server.inject(options); - - expect(response.result.data.attributes['has-seen-level-seven-info']).to.be.true; - }); - }); - }); -}); diff --git a/api/tests/evaluation/unit/application/users/user-controller_test.js b/api/tests/evaluation/unit/application/users/user-controller_test.js index e98d31e96ee..c36e8d906bf 100644 --- a/api/tests/evaluation/unit/application/users/user-controller_test.js +++ b/api/tests/evaluation/unit/application/users/user-controller_test.js @@ -3,35 +3,6 @@ import { evaluationUsecases } from '../../../../../src/evaluation/domain/usecase import { expect, hFake, sinon } from '../../../../test-helper.js'; describe('Unit | Controller | user-controller', function () { - describe('#rememberUserHasSeenLevelSevenInfo', function () { - it('should remember user has seen level seven info', async function () { - // given - const userId = 1; - const userInformation = Symbol('userInformation'); - const userInformationSerialized = Symbol('userInformationSerialized'); - const userSerializer = { - serialize: sinon.stub(), - }; - - sinon.stub(evaluationUsecases, 'rememberUserHasSeenLevelSevenInfo'); - evaluationUsecases.rememberUserHasSeenLevelSevenInfo.withArgs({ userId }).resolves(userInformation); - userSerializer.serialize.withArgs(userInformation).returns(userInformationSerialized); - - // when - const response = await userController.rememberUserHasSeenLevelSevenInfo( - { - auth: { credentials: { userId } }, - params: { id: userId }, - }, - hFake, - { userSerializer }, - ); - - // then - expect(response).to.be.equal(userInformationSerialized); - }); - }); - describe('#rememberUserHasSeenNewDashboardInfo', function () { it('should remember user has seen new dashboard info', async function () { // given diff --git a/api/tests/evaluation/unit/domain/usecases/remember-user-has-seen-level-seven-info_test.js b/api/tests/evaluation/unit/domain/usecases/remember-user-has-seen-level-seven-info_test.js deleted file mode 100644 index d40e213c1ea..00000000000 --- a/api/tests/evaluation/unit/domain/usecases/remember-user-has-seen-level-seven-info_test.js +++ /dev/null @@ -1,20 +0,0 @@ -import { rememberUserHasSeenLevelSevenInfo } from '../../../../../src/evaluation/domain/usecases/remember-user-has-seen-level-seven-info.js'; -import { expect, sinon } from '../../../../test-helper.js'; - -describe('Unit | UseCase | remember-user-has-seen-level-seven-info', function () { - it('should return user information', async function () { - // given - const userRepository = { updateMarkLevelSevenInfoAsSeen: sinon.stub() }; - const userId = 1; - userRepository.updateMarkLevelSevenInfoAsSeen.withArgs({ userId }).resolves(); - - // when - await rememberUserHasSeenLevelSevenInfo({ - userId, - userRepository, - }); - - // then - expect(userRepository.updateMarkLevelSevenInfoAsSeen).to.have.been.calledOnce; - }); -}); diff --git a/api/tests/identity-access-management/acceptance/application/user/user.route.test.js b/api/tests/identity-access-management/acceptance/application/user/user.route.test.js index b4fcbc4aeb7..a81b2fe5834 100644 --- a/api/tests/identity-access-management/acceptance/application/user/user.route.test.js +++ b/api/tests/identity-access-management/acceptance/application/user/user.route.test.js @@ -235,7 +235,6 @@ describe('Acceptance | Identity Access Management | Application | Route | User', 'has-seen-new-dashboard-info': user.hasSeenNewDashboardInfo, 'has-seen-focused-challenge-tooltip': user.hasSeenFocusedChallengeTooltip, 'has-seen-other-challenges-tooltip': user.hasSeenOtherChallengesTooltip, - 'has-seen-level-seven-info': false, 'has-assessment-participations': true, 'code-for-last-profile-to-share': expectedCode, 'has-recommended-trainings': true, diff --git a/api/tests/identity-access-management/integration/application/api/users-api_test.js b/api/tests/identity-access-management/integration/application/api/users-api_test.js index ffb39c06bfa..bd657b227f6 100644 --- a/api/tests/identity-access-management/integration/application/api/users-api_test.js +++ b/api/tests/identity-access-management/integration/application/api/users-api_test.js @@ -2,20 +2,6 @@ import * as userApi from '../../../../../src/identity-access-management/applicat import { databaseBuilder, expect } from '../../../../test-helper.js'; describe('Integration | Application | users-api', function () { - describe('#markLevelSevenInfoAsSeen', function () { - it('should return user information', async function () { - // given - const userId = databaseBuilder.factory.buildUser({ hasSeenLevelSevenInfo: false }).id; - await databaseBuilder.commit(); - - // when - const actualUser = await userApi.markLevelSevenInfoAsSeen({ userId }); - - // then - expect(actualUser.hasSeenLevelSevenInfo).to.be.true; - }); - }); - describe('#markNewDashboardInfoAsSeen', function () { it('should return user information', async function () { // given diff --git a/api/tests/identity-access-management/unit/domain/models/User.test.js b/api/tests/identity-access-management/unit/domain/models/User.test.js index 198b845647f..0afd398fa1d 100644 --- a/api/tests/identity-access-management/unit/domain/models/User.test.js +++ b/api/tests/identity-access-management/unit/domain/models/User.test.js @@ -612,7 +612,6 @@ describe('Unit | Identity Access Management | Domain | Model | User', function ( 'hasSeenAssessmentInstructions', 'hasSeenOtherChallengesTooltip', 'hasSeenNewDashboardInfo', - 'hasSeenLevelSevenInfo', 'hasSeenFocusedChallengeTooltip', 'lang', 'locale', diff --git a/api/tests/identity-access-management/unit/domain/usecases/remember-user-has-seen-level-seven-information.usecase.test.js b/api/tests/identity-access-management/unit/domain/usecases/remember-user-has-seen-level-seven-information.usecase.test.js deleted file mode 100644 index b430a659df7..00000000000 --- a/api/tests/identity-access-management/unit/domain/usecases/remember-user-has-seen-level-seven-information.usecase.test.js +++ /dev/null @@ -1,21 +0,0 @@ -import { User } from '../../../../../src/identity-access-management/domain/models/User.js'; -import { rememberUserHasSeenLevelSevenInformation } from '../../../../../src/identity-access-management/domain/usecases/remember-user-has-seen-level-seven-information.usecase.js'; -import { expect, sinon } from '../../../../test-helper.js'; - -describe('Unit | Identity Access Management | Domain | UseCase | remember-user-has-seen-level-seven-information', function () { - it('updates the last data protection policy to now', async function () { - // given - const userRepository = { - updateHasSeenLevelSevenInfoToTrue: sinon.stub(), - }; - const userId = 1; - const user = new User({ id: userId, lastDataProtectionPolicySeenAt: null }); - userRepository.updateHasSeenLevelSevenInfoToTrue.resolves(user); - - // when - await rememberUserHasSeenLevelSevenInformation({ userId, userRepository }); - - // then - expect(userRepository.updateHasSeenLevelSevenInfoToTrue).to.have.been.calledWithExactly(userId); - }); -}); diff --git a/api/tests/identity-access-management/unit/infrastructure/serializers/jsonapi/user-with-activity.serializer.test.js b/api/tests/identity-access-management/unit/infrastructure/serializers/jsonapi/user-with-activity.serializer.test.js index 90e40475dbf..3484d496586 100644 --- a/api/tests/identity-access-management/unit/infrastructure/serializers/jsonapi/user-with-activity.serializer.test.js +++ b/api/tests/identity-access-management/unit/infrastructure/serializers/jsonapi/user-with-activity.serializer.test.js @@ -25,7 +25,6 @@ describe('Unit | Identity Access Management | Infrastructure | Serializer | JSON hasSeenFocusedChallengeTooltip: false, hasSeenOtherChallengesTooltip: false, hasSeenNewDashboardInfo: false, - hasSeenLevelSevenInfo: false, lastDataProtectionPolicySeenAt: '2022-05-04T13:00:00.000Z', }), hasAssessmentParticipations: false, @@ -56,7 +55,6 @@ describe('Unit | Identity Access Management | Infrastructure | Serializer | JSON 'pix-certif-terms-of-service-accepted': userModelObject.pixCertifTermsOfServiceAccepted, 'has-seen-assessment-instructions': userModelObject.hasSeenAssessmentInstructions, 'has-seen-new-dashboard-info': userModelObject.hasSeenNewDashboardInfo, - 'has-seen-level-seven-info': userModelObject.hasSeenLevelSevenInfo, 'has-seen-focused-challenge-tooltip': userModelObject.hasSeenFocusedChallengeTooltip, 'has-seen-other-challenges-tooltip': userModelObject.hasSeenOtherChallengesTooltip, 'last-data-protection-policy-seen-at': userModelObject.lastDataProtectionPolicySeenAt, diff --git a/api/tests/shared/unit/infrastructure/serializers/jsonapi/user-serializer_test.js b/api/tests/shared/unit/infrastructure/serializers/jsonapi/user-serializer_test.js index 39d5187b189..1dc712185aa 100644 --- a/api/tests/shared/unit/infrastructure/serializers/jsonapi/user-serializer_test.js +++ b/api/tests/shared/unit/infrastructure/serializers/jsonapi/user-serializer_test.js @@ -26,7 +26,6 @@ describe('Unit | Shared | Infrastructure | Serializer | JSONAPI | user-serialize hasSeenFocusedChallengeTooltip: false, hasSeenOtherChallengesTooltip: false, hasSeenNewDashboardInfo: false, - hasSeenLevelSevenInfo: false, lastDataProtectionPolicySeenAt: '2022-12-24T10:00:00.000Z', }); }); @@ -53,7 +52,6 @@ describe('Unit | Shared | Infrastructure | Serializer | JSONAPI | user-serialize 'pix-certif-terms-of-service-accepted': userModelObject.pixCertifTermsOfServiceAccepted, 'has-seen-assessment-instructions': userModelObject.hasSeenAssessmentInstructions, 'has-seen-new-dashboard-info': userModelObject.hasSeenNewDashboardInfo, - 'has-seen-level-seven-info': userModelObject.hasSeenLevelSevenInfo, 'has-seen-focused-challenge-tooltip': userModelObject.hasSeenFocusedChallengeTooltip, 'has-seen-other-challenges-tooltip': userModelObject.hasSeenOtherChallengesTooltip, 'last-data-protection-policy-seen-at': userModelObject.lastDataProtectionPolicySeenAt, diff --git a/api/tests/unit/tooling/database-builder/database-helpers_test.js b/api/tests/unit/tooling/database-builder/database-helpers_test.js index 220987e92d5..244f8f92056 100644 --- a/api/tests/unit/tooling/database-builder/database-helpers_test.js +++ b/api/tests/unit/tooling/database-builder/database-helpers_test.js @@ -10,7 +10,7 @@ describe('Unit | Tooling | DatabaseBuilder | database-helpers', function () { { expectedTableName: 'users', insertSqlQuery: - '/* path: */ insert into "users" ("cgu", "createdAt", "email", "emailConfirmedAt", "firstName", "hasBeenAnonymised", "hasBeenAnonymisedBy", "hasSeenAssessmentInstructions", "hasSeenFocusedChallengeTooltip", "hasSeenLevelSevenInfo", "hasSeenNewDashboardInfo", "hasSeenOtherChallengesTooltip", "id", "isAnonymous", "lang", "lastDataProtectionPolicySeenAt", "lastName", "lastPixCertifTermsOfServiceValidatedAt", "lastPixOrgaTermsOfServiceValidatedAt", "lastTermsOfServiceValidatedAt", "locale", "mustValidateTermsOfService", "pixCertifTermsOfServiceAccepted", "pixOrgaTermsOfServiceAccepted", "updatedAt", "username") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, DEFAULT, $21, $22, $23, $24, $25)', + '/* path: */ insert into "users" ("cgu", "createdAt", "email", "emailConfirmedAt", "firstName", "hasBeenAnonymised", "hasBeenAnonymisedBy", "hasSeenAssessmentInstructions", "hasSeenFocusedChallengeTooltip", "hasSeenNewDashboardInfo", "hasSeenOtherChallengesTooltip", "id", "isAnonymous", "lang", "lastDataProtectionPolicySeenAt", "lastName", "lastPixCertifTermsOfServiceValidatedAt", "lastPixOrgaTermsOfServiceValidatedAt", "lastTermsOfServiceValidatedAt", "locale", "mustValidateTermsOfService", "pixCertifTermsOfServiceAccepted", "pixOrgaTermsOfServiceAccepted", "updatedAt", "username") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, DEFAULT, $21, $22, $23, $24, $25)', }, { expectedTableName: 'pgboss.job',