diff --git a/backend/package.json b/backend/package.json index 4339f32ed..0b9e25447 100644 --- a/backend/package.json +++ b/backend/package.json @@ -48,7 +48,7 @@ "apollo-client": "~2.6.3", "apollo-link-context": "~1.0.18", "apollo-link-http": "~1.5.15", - "apollo-server": "~2.6.6", + "apollo-server": "~2.6.8", "bcryptjs": "~2.4.3", "cheerio": "~1.0.0-rc.3", "cors": "~2.8.5", @@ -68,7 +68,7 @@ "helmet": "~3.18.0", "jsonwebtoken": "~8.5.1", "linkifyjs": "~2.1.8", - "lodash": "~4.17.11", + "lodash": "~4.17.13", "merge-graphql-schemas": "^1.5.8", "neo4j-driver": "~1.7.4", "neo4j-graphql-js": "^2.6.3", @@ -85,12 +85,12 @@ }, "devDependencies": { "@babel/cli": "~7.5.0", - "@babel/core": "~7.5.0", + "@babel/core": "~7.5.4", "@babel/node": "~7.5.0", "@babel/plugin-proposal-throw-expressions": "^7.2.0", - "@babel/preset-env": "~7.5.2", + "@babel/preset-env": "~7.5.4", "@babel/register": "~7.4.4", - "apollo-server-testing": "~2.6.7", + "apollo-server-testing": "~2.6.8", "babel-core": "~7.0.0-0", "babel-eslint": "~10.0.2", "babel-jest": "~24.8.0", diff --git a/backend/src/bootstrap/neode.js b/backend/src/bootstrap/neode.js index 419cb1032..65a2074be 100644 --- a/backend/src/bootstrap/neode.js +++ b/backend/src/bootstrap/neode.js @@ -1,88 +1,9 @@ import Neode from 'neode' -import uuid from 'uuid/v4' +import models from '../models' export default function setupNeode(options) { const { uri, username, password } = options const neodeInstance = new Neode(uri, username, password) - neodeInstance.model('InvitationCode', { - createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, - token: { type: 'string', primary: true, token: true }, - generatedBy: { - type: 'relationship', - relationship: 'GENERATED', - target: 'User', - direction: 'in', - }, - activated: { - type: 'relationship', - relationship: 'ACTIVATED', - target: 'EmailAddress', - direction: 'out', - }, - }) - neodeInstance.model('EmailAddress', { - email: { type: 'string', primary: true, lowercase: true, email: true }, - createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, - verifiedAt: { type: 'string', isoDate: true }, - nonce: { type: 'string', token: true }, - belongsTo: { - type: 'relationship', - relationship: 'BELONGS_TO', - target: 'User', - direction: 'out', - }, - }) - neodeInstance.model('User', { - id: { type: 'string', primary: true, default: uuid }, // TODO: should be type: 'uuid' but simplified for our tests - actorId: { type: 'string', allow: [null] }, - name: { type: 'string', min: 3 }, - email: { type: 'string', lowercase: true, email: true }, - slug: 'string', - encryptedPassword: 'string', - avatar: { type: 'string', allow: [null] }, - coverImg: { type: 'string', allow: [null] }, - deleted: { type: 'boolean', default: false }, - disabled: { type: 'boolean', default: false }, - role: 'string', - publicKey: 'string', - privateKey: 'string', - wasInvited: 'boolean', - wasSeeded: 'boolean', - locationName: { type: 'string', allow: [null] }, - about: { type: 'string', allow: [null] }, - primaryEmail: { - type: 'relationship', - relationship: 'PRIMARY_EMAIL', - target: 'EmailAddress', - direction: 'out', - }, - following: { - type: 'relationship', - relationship: 'FOLLOWS', - target: 'User', - direction: 'out', - }, - followedBy: { - type: 'relationship', - relationship: 'FOLLOWS', - target: 'User', - direction: 'in', - }, - friends: { type: 'relationship', relationship: 'FRIENDS', target: 'User', direction: 'both' }, - disabledBy: { - type: 'relationship', - relationship: 'DISABLED', - target: 'User', - direction: 'in', - }, - invitedBy: { type: 'relationship', relationship: 'INVITED', target: 'User', direction: 'in' }, - createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, - updatedAt: { - type: 'string', - isoDate: true, - required: true, - default: () => new Date().toISOString(), - }, - }) + neodeInstance.with(models) return neodeInstance } diff --git a/backend/src/models/EmailAddress.js b/backend/src/models/EmailAddress.js new file mode 100644 index 000000000..ddd56c297 --- /dev/null +++ b/backend/src/models/EmailAddress.js @@ -0,0 +1,12 @@ +module.exports = { + email: { type: 'string', primary: true, lowercase: true, email: true }, + createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, + verifiedAt: { type: 'string', isoDate: true }, + nonce: { type: 'string', token: true }, + belongsTo: { + type: 'relationship', + relationship: 'BELONGS_TO', + target: 'User', + direction: 'out', + }, +} diff --git a/backend/src/models/InvitationCode.js b/backend/src/models/InvitationCode.js new file mode 100644 index 000000000..f137f6c15 --- /dev/null +++ b/backend/src/models/InvitationCode.js @@ -0,0 +1,16 @@ +module.exports = { + createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, + token: { type: 'string', primary: true, token: true }, + generatedBy: { + type: 'relationship', + relationship: 'GENERATED', + target: 'User', + direction: 'in', + }, + activated: { + type: 'relationship', + relationship: 'ACTIVATED', + target: 'EmailAddress', + direction: 'out', + }, +} diff --git a/backend/src/models/User.js b/backend/src/models/User.js new file mode 100644 index 000000000..d8f768ae9 --- /dev/null +++ b/backend/src/models/User.js @@ -0,0 +1,54 @@ +import uuid from 'uuid/v4' + +module.exports = { + id: { type: 'string', primary: true, default: uuid }, // TODO: should be type: 'uuid' but simplified for our tests + actorId: { type: 'string', allow: [null] }, + name: { type: 'string', min: 3 }, + email: { type: 'string', lowercase: true, email: true }, + slug: 'string', + encryptedPassword: 'string', + avatar: { type: 'string', allow: [null] }, + coverImg: { type: 'string', allow: [null] }, + deleted: { type: 'boolean', default: false }, + disabled: { type: 'boolean', default: false }, + role: { type: 'string', default: 'user' }, + publicKey: 'string', + privateKey: 'string', + wasInvited: 'boolean', + wasSeeded: 'boolean', + locationName: { type: 'string', allow: [null] }, + about: { type: 'string', allow: [null] }, + primaryEmail: { + type: 'relationship', + relationship: 'PRIMARY_EMAIL', + target: 'EmailAddress', + direction: 'out', + }, + following: { + type: 'relationship', + relationship: 'FOLLOWS', + target: 'User', + direction: 'out', + }, + followedBy: { + type: 'relationship', + relationship: 'FOLLOWS', + target: 'User', + direction: 'in', + }, + friends: { type: 'relationship', relationship: 'FRIENDS', target: 'User', direction: 'both' }, + disabledBy: { + type: 'relationship', + relationship: 'DISABLED', + target: 'User', + direction: 'in', + }, + invitedBy: { type: 'relationship', relationship: 'INVITED', target: 'User', direction: 'in' }, + createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, + updatedAt: { + type: 'string', + isoDate: true, + required: true, + default: () => new Date().toISOString(), + }, +} diff --git a/backend/src/models/User.spec.js b/backend/src/models/User.spec.js new file mode 100644 index 000000000..e00136970 --- /dev/null +++ b/backend/src/models/User.spec.js @@ -0,0 +1,20 @@ +import Factory from '../seed/factories' +import { neode } from '../bootstrap/neo4j' + +const factory = Factory() +const instance = neode() + +afterEach(async () => { + await factory.cleanDatabase() +}) + +describe('role', () => { + it('defaults to `user`', async () => { + const user = await instance.create('User', { name: 'John' }) + await expect(user.toJson()).resolves.toEqual( + expect.objectContaining({ + role: 'user', + }), + ) + }) +}) diff --git a/backend/src/models/index.js b/backend/src/models/index.js new file mode 100644 index 000000000..0e6ae5864 --- /dev/null +++ b/backend/src/models/index.js @@ -0,0 +1,7 @@ +// NOTE: We cannot use `fs` here to clean up the code. Cypress breaks on any npm +// module that is not browser-compatible. Node's `fs` module is server-side only +export default { + User: require('./User.js'), + InvitationCode: require('./InvitationCode.js'), + EmailAddress: require('./EmailAddress.js'), +} diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql index 314f03521..b984f2d79 100644 --- a/backend/src/schema/types/type/User.gql +++ b/backend/src/schema/types/type/User.gql @@ -9,7 +9,7 @@ type User { deleted: Boolean disabled: Boolean disabledBy: User @relation(name: "DISABLED", direction: "IN") - role: UserGroup + role: UserGroup! publicKey: String invitedBy: User @relation(name: "INVITED", direction: "IN") invited: [User] @relation(name: "INVITED", direction: "OUT") diff --git a/backend/yarn.lock b/backend/yarn.lock index 596a0c917..398bcc61a 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -38,14 +38,14 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@^7.1.0", "@babel/core@~7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.0.tgz#6ed6a2881ad48a732c5433096d96d1b0ee5eb734" - integrity sha512-6Isr4X98pwXqHvtigw71CKgmhL1etZjPs5A67jL/w0TkLM9eqmFR40YrnJvEc1WnMZFsskjsmid8bHZyxKEAnw== +"@babel/core@^7.1.0", "@babel/core@~7.5.4": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.4.tgz#4c32df7ad5a58e9ea27ad025c11276324e0b4ddd" + integrity sha512-+DaeBEpYq6b2+ZmHx3tHspC+ZRflrvLqwfv8E3hNr5LVQoyBnL8RPKSBCg+rK2W2My9PWlujBiqd0ZPsR9Q6zQ== dependencies: "@babel/code-frame" "^7.0.0" "@babel/generator" "^7.5.0" - "@babel/helpers" "^7.5.0" + "@babel/helpers" "^7.5.4" "@babel/parser" "^7.5.0" "@babel/template" "^7.4.4" "@babel/traverse" "^7.5.0" @@ -260,10 +260,10 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.2.0" -"@babel/helpers@^7.5.0": - version "7.5.2" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.2.tgz#97424dc82fc0041f4c751119b4d2b1ec68cdb5ba" - integrity sha512-NDkkTqDvgFUeo8djXBOiwO/mFjownznOWvmP9hvNdfiFUmx0nwNOqxuaTTbxjH744eQsD9M5ubC7gdANBvIWPw== +"@babel/helpers@^7.5.4": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.4.tgz#2f00608aa10d460bde0ccf665d6dcf8477357cf0" + integrity sha512-6LJ6xwUEJP51w0sIgKyfvFMJvIb9mWAfohJp0+m6eHJigkFdcH8duZ1sfhn0ltJRzwUIT/yqqhdSfRpCpL7oow== dependencies: "@babel/template" "^7.4.4" "@babel/traverse" "^7.5.0" @@ -320,10 +320,10 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-json-strings" "^7.2.0" -"@babel/plugin-proposal-object-rest-spread@^7.5.2": - version "7.5.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.2.tgz#ec92b0c6419074ea7af77c78b7c5d42041f2f5a9" - integrity sha512-C/JU3YOx5J4d9s0GGlJlYXVwsbd5JmqQ0AvB7cIDAx7nN57aDTnlJEsZJPuSskeBtMGFWSWU5Q+piTiDe0s7FQ== +"@babel/plugin-proposal-object-rest-spread@^7.5.4": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.4.tgz#250de35d867ce8260a31b1fdac6c4fc1baa99331" + integrity sha512-KCx0z3y7y8ipZUMAEEJOyNi11lMb/FOPUjjB113tfowgw0c16EGYos7worCKBcUAh2oG+OBnoUhsnTSoLpV9uA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.2.0" @@ -649,17 +649,17 @@ core-js "^2.5.7" regenerator-runtime "^0.12.0" -"@babel/preset-env@~7.5.2": - version "7.5.2" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.5.2.tgz#34a46f01aed617b174b8dbaf8fed9239300343d0" - integrity sha512-7rRJLaUqJhQ+8xGrWtMROAgOi/+udIzyK2ES9NHhDIUvR2zfx/ON5lRR8ACUGehIYst8KVbl4vpkgOqn08gBxA== +"@babel/preset-env@~7.5.4": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.5.4.tgz#64bc15041a3cbb0798930319917e70fcca57713d" + integrity sha512-hFnFnouyRNiH1rL8YkX1ANCNAUVC8Djwdqfev8i1415tnAG+7hlA5zhZ0Q/3Q5gkop4HioIPbCEWAalqcbxRoQ== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-async-generator-functions" "^7.2.0" "@babel/plugin-proposal-dynamic-import" "^7.5.0" "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.5.2" + "@babel/plugin-proposal-object-rest-spread" "^7.5.4" "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" "@babel/plugin-syntax-async-generators" "^7.2.0" @@ -1406,18 +1406,6 @@ apollo-engine-reporting-protobuf@0.3.1: dependencies: protobufjs "^6.8.6" -apollo-engine-reporting@1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/apollo-engine-reporting/-/apollo-engine-reporting-1.3.4.tgz#65e12f94221d80b3b1740c26e82ce9bb6bdfb7ee" - integrity sha512-DJdYghyUBzT0/LcPLwuQNXDCw06r1RfxkVfNTGKoTv6a+leVvjhDJmXvc+jSuBPwaNsc+RYRnfyQ2qUn9fmfyA== - dependencies: - apollo-engine-reporting-protobuf "0.3.1" - apollo-graphql "^0.3.2" - apollo-server-core "2.6.6" - apollo-server-env "2.4.0" - async-retry "^1.2.1" - graphql-extensions "0.7.5" - apollo-engine-reporting@1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/apollo-engine-reporting/-/apollo-engine-reporting-1.3.5.tgz#075424d39dfe77a20f96e8e33b7ae52d58c38e1e" @@ -1447,14 +1435,6 @@ apollo-errors@^1.9.0: assert "^1.4.1" extendable-error "^0.1.5" -apollo-graphql@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/apollo-graphql/-/apollo-graphql-0.3.2.tgz#8881a87f1d5fcf80837b34dba90737e664eabe9a" - integrity sha512-YbzYGR14GV0023m//EU66vOzZ3i7c04V/SF8Qk+60vf1sOWyKgO6mxZJ4BKhw10qWUayirhSDxq3frYE+qSG0A== - dependencies: - apollo-env "0.5.1" - lodash.sortby "^4.7.0" - apollo-graphql@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/apollo-graphql/-/apollo-graphql-0.3.3.tgz#ce1df194f6e547ad3ce1e35b42f9c211766e1658" @@ -1506,32 +1486,6 @@ apollo-server-caching@0.4.0: dependencies: lru-cache "^5.0.0" -apollo-server-core@2.6.6: - version "2.6.6" - resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.6.6.tgz#55fea7980a943948c49dea20d81b9bbfc0e04f87" - integrity sha512-PFSjJbqkV1eetfFJxu11gzklQYC8BrF0RZfvC1d1mhvtxAOKl25uhPHxltN0Omyjp7LW4YeoC6zwl9rLWuhZFQ== - dependencies: - "@apollographql/apollo-tools" "^0.3.6" - "@apollographql/graphql-playground-html" "1.6.20" - "@types/ws" "^6.0.0" - apollo-cache-control "0.7.4" - apollo-datasource "0.5.0" - apollo-engine-reporting "1.3.4" - apollo-server-caching "0.4.0" - apollo-server-env "2.4.0" - apollo-server-errors "2.3.0" - apollo-server-plugin-base "0.5.5" - apollo-tracing "0.7.3" - fast-json-stable-stringify "^2.0.0" - graphql-extensions "0.7.5" - graphql-subscriptions "^1.0.0" - graphql-tag "^2.9.2" - graphql-tools "^4.0.0" - graphql-upload "^8.0.2" - sha.js "^2.4.11" - subscriptions-transport-ws "^0.9.11" - ws "^6.0.0" - apollo-server-core@2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.6.7.tgz#85b0310f40cfec43a702569c73af16d88776a6f0" @@ -1558,6 +1512,32 @@ apollo-server-core@2.6.7: subscriptions-transport-ws "^0.9.11" ws "^6.0.0" +apollo-server-core@2.6.8: + version "2.6.8" + resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.6.8.tgz#c8758b5f26b5f3b9fef51b911265b80a9ce5251d" + integrity sha512-Jxw+6R/2I2LiZ6kjRFTzPpdjw7HfuVLfNU+svgNlxioLducxBH/wqUs3qYTf4eVUUtWy+nSS/BUf/Ullo+Ur0Q== + dependencies: + "@apollographql/apollo-tools" "^0.3.6" + "@apollographql/graphql-playground-html" "1.6.20" + "@types/ws" "^6.0.0" + apollo-cache-control "0.7.4" + apollo-datasource "0.5.0" + apollo-engine-reporting "1.3.5" + apollo-server-caching "0.4.0" + apollo-server-env "2.4.0" + apollo-server-errors "2.3.0" + apollo-server-plugin-base "0.5.7" + apollo-tracing "0.7.3" + fast-json-stable-stringify "^2.0.0" + graphql-extensions "0.7.6" + graphql-subscriptions "^1.0.0" + graphql-tag "^2.9.2" + graphql-tools "^4.0.0" + graphql-upload "^8.0.2" + sha.js "^2.4.11" + subscriptions-transport-ws "^0.9.11" + ws "^6.0.0" + apollo-server-core@^1.3.6, apollo-server-core@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-1.4.0.tgz#4faff7f110bfdd6c3f47008302ae24140f94c592" @@ -1580,10 +1560,10 @@ apollo-server-errors@2.3.0: resolved "https://registry.yarnpkg.com/apollo-server-errors/-/apollo-server-errors-2.3.0.tgz#700622b66a16dffcad3b017e4796749814edc061" integrity sha512-rUvzwMo2ZQgzzPh2kcJyfbRSfVKRMhfIlhY7BzUfM4x6ZT0aijlgsf714Ll3Mbf5Fxii32kD0A/DmKsTecpccw== -apollo-server-express@2.6.6: - version "2.6.6" - resolved "https://registry.yarnpkg.com/apollo-server-express/-/apollo-server-express-2.6.6.tgz#ec2b955354d7dd4d12fe01ea7e983d302071d5b9" - integrity sha512-bY/xrr9lZH+hsjchiQuSXpW3ivXfL1h81M5VE9Ppus1PVwwEIar/irBN+PFp97WxERZPDjVZzrRKa+lRHjtJsA== +apollo-server-express@2.6.8: + version "2.6.8" + resolved "https://registry.yarnpkg.com/apollo-server-express/-/apollo-server-express-2.6.8.tgz#9f3e29f7087af669f05d75dfd335b4a9383ba48e" + integrity sha512-LQzVHknQDkHWffc2qK9dr/qNxQ/WecSKiye5/w10tXrOy3aruTFe67ysG/vMnFZ/puroqiZ2njHzhHZztqQ4sA== dependencies: "@apollographql/graphql-playground-html" "1.6.20" "@types/accepts" "^1.3.5" @@ -1591,7 +1571,7 @@ apollo-server-express@2.6.6: "@types/cors" "^2.8.4" "@types/express" "4.17.0" accepts "^1.3.5" - apollo-server-core "2.6.6" + apollo-server-core "2.6.8" body-parser "^1.18.3" cors "^2.8.4" graphql-subscriptions "^1.0.0" @@ -1619,30 +1599,30 @@ apollo-server-module-graphiql@^1.3.4, apollo-server-module-graphiql@^1.4.0: resolved "https://registry.yarnpkg.com/apollo-server-module-graphiql/-/apollo-server-module-graphiql-1.4.0.tgz#c559efa285578820709f1769bb85d3b3eed3d8ec" integrity sha512-GmkOcb5he2x5gat+TuiTvabnBf1m4jzdecal3XbXBh/Jg+kx4hcvO3TTDFQ9CuTprtzdcVyA11iqG7iOMOt7vA== -apollo-server-plugin-base@0.5.5: - version "0.5.5" - resolved "https://registry.yarnpkg.com/apollo-server-plugin-base/-/apollo-server-plugin-base-0.5.5.tgz#364e4a2fca4d95ddeb9fd3e78940ed1da58865c2" - integrity sha512-agiuhknyu3lnnEsqUh99tzxwPCGp+TuDK+TSRTkXU1RUG6lY4C3uJp0JGJw03cP+M6ze73TbRjMA4E68g/ks5A== - apollo-server-plugin-base@0.5.6: version "0.5.6" resolved "https://registry.yarnpkg.com/apollo-server-plugin-base/-/apollo-server-plugin-base-0.5.6.tgz#3a7128437a0f845e7d873fa43ef091ff7bf27975" integrity sha512-wJvcPqfm/kiBwY5JZT85t2A4pcHv24xdQIpWMNt1zsnx77lIZqJmhsc22eSUSrlnYqUMXC4XMVgSUfAO4oI9wg== -apollo-server-testing@~2.6.7: - version "2.6.7" - resolved "https://registry.yarnpkg.com/apollo-server-testing/-/apollo-server-testing-2.6.7.tgz#cfc6366921eb99fd0cbc5d02552a8a5b268787d5" - integrity sha512-lqgZuSqBd5hkRILeVEleo2ScJjukR/E71Mv67vPBUs01s0gEHNnjSRnuOJJOM3cAFBQOdKPc42cHGANzf2ZZTw== - dependencies: - apollo-server-core "2.6.7" +apollo-server-plugin-base@0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/apollo-server-plugin-base/-/apollo-server-plugin-base-0.5.7.tgz#267faeb5c2de7fa8d3be469cb99f82f601be7aed" + integrity sha512-HeEwEZ92c2XYRV+0CFLbstW3vUJ4idCxR9E9Q3wwvhXrq8gaGzqyDoC8EzAzRxCJUKcEn7xQOpT/AUTC/KtkRA== -apollo-server@~2.6.6: - version "2.6.6" - resolved "https://registry.yarnpkg.com/apollo-server/-/apollo-server-2.6.6.tgz#0570fce4a682eb1de8bc1b86dbe2543de440cd4e" - integrity sha512-7Bulb3RnOO4/SGA66LXu3ZHCXIK8MYMrsxy4yti1/adDIUmcniolDqJwOYUGoTmv1AQjRxgJb4TVZ0Dk9nrrYg== +apollo-server-testing@~2.6.8: + version "2.6.8" + resolved "https://registry.yarnpkg.com/apollo-server-testing/-/apollo-server-testing-2.6.8.tgz#e75364df7fdc2d6a11023f8a0f72a14309b90800" + integrity sha512-pch2I+8QhdXBMnGDctVth4BcZ5hocwY/ogtBMoQuv7H2HBnlDOz7dCM9BH4TW3+Tk6cFgvLTaDtLJ+NxMCtyVA== dependencies: - apollo-server-core "2.6.6" - apollo-server-express "2.6.6" + apollo-server-core "2.6.8" + +apollo-server@~2.6.8: + version "2.6.8" + resolved "https://registry.yarnpkg.com/apollo-server/-/apollo-server-2.6.8.tgz#5f3cf5cf4f2feccbded0cb03fa37dcd8260e5c6a" + integrity sha512-BxwaGxnD3GPuZAAqsexVHFvDlF/s2X8pILgYQ4x+VhUkMeQ12DHQtKPuxn2v2GYwH0U/GDXNohkgwxF/5eTDsQ== + dependencies: + apollo-server-core "2.6.8" + apollo-server-express "2.6.8" express "^4.0.0" graphql-subscriptions "^1.0.0" graphql-tools "^4.0.0" @@ -3854,13 +3834,6 @@ graphql-extensions@0.7.4: dependencies: "@apollographql/apollo-tools" "^0.3.6" -graphql-extensions@0.7.5: - version "0.7.5" - resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.7.5.tgz#fab2b9e53cf6014952e6547456d50680ff0ea579" - integrity sha512-B1m+/WEJa3IYKWqBPS9W/7OasfPmlHOSz5hpEAq2Jbn6T0FQ/d2YWFf2HBETHR3RR2qfT+55VMiYovl2ga3qcg== - dependencies: - "@apollographql/apollo-tools" "^0.3.6" - graphql-extensions@0.7.6: version "0.7.6" resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.7.6.tgz#80cdddf08b0af12525529d1922ee2ea0d0cc8ecf" @@ -5428,10 +5401,10 @@ lodash@=3.10.1: resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" integrity sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y= -lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5, lodash@~4.17.11: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== +lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5, lodash@~4.17.13: + version "4.17.13" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.13.tgz#0bdc3a6adc873d2f4e0c4bac285df91b64fc7b93" + integrity sha512-vm3/XWXfWtRua0FkUyEHBZy8kCPjErNBT9fJx8Zvs+U6zjqPbTUOpkaoum3O5uiA8sm+yNMHXfYkTUHFoMxFNA== long@^4.0.0: version "4.0.0" diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index f8d18baa0..f996db992 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -276,9 +276,9 @@ When("I fill the password form with:", table => { table = table.rowsHash(); cy.get("input[id=oldPassword]") .type(table["Your old password"]) - .get("input[id=newPassword]") + .get("input[id=password]") .type(table["Your new passsword"]) - .get("input[id=confirmPassword]") + .get("input[id=passwordConfirmation]") .type(table["Confirm new password"]); }); diff --git a/package.json b/package.json index bfec1d73a..b93b154ac 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "bcryptjs": "^2.4.3", "codecov": "^3.5.0", "cross-env": "^5.2.0", - "cypress": "^3.3.2", + "cypress": "^3.4.0", "cypress-cucumber-preprocessor": "^1.12.0", "cypress-file-upload": "^3.2.0", "cypress-plugin-retries": "^1.2.2", diff --git a/webapp/assets/styles/main.scss b/webapp/assets/styles/main.scss index 560249b4a..11652fad0 100644 --- a/webapp/assets/styles/main.scss +++ b/webapp/assets/styles/main.scss @@ -66,7 +66,8 @@ blockquote { border-left: 3px dotted $color-neutral-70; &::before { - content: '\201C'; /*Unicode for Left Double Quote*/ + content: '\201C'; + /*Unicode for Left Double Quote*/ /*Font*/ font-size: $font-size-xxxx-large; diff --git a/webapp/components/Password/Change.spec.js b/webapp/components/Password/Change.spec.js index a15695a55..ef89c34f7 100644 --- a/webapp/components/Password/Change.spec.js +++ b/webapp/components/Password/Change.spec.js @@ -54,7 +54,7 @@ describe('ChangePassword.vue', () => { describe('match', () => { beforeEach(() => { wrapper.find('input#oldPassword').setValue('some secret') - wrapper.find('input#newPassword').setValue('some secret') + wrapper.find('input#password').setValue('some secret') }) it('invalid', () => { @@ -90,8 +90,8 @@ describe('ChangePassword.vue', () => { describe('given valid input', () => { beforeEach(() => { wrapper.find('input#oldPassword').setValue('supersecret') - wrapper.find('input#newPassword').setValue('superdupersecret') - wrapper.find('input#confirmPassword').setValue('superdupersecret') + wrapper.find('input#password').setValue('superdupersecret') + wrapper.find('input#passwordConfirmation').setValue('superdupersecret') }) describe('submit form', () => { @@ -109,8 +109,8 @@ describe('ChangePassword.vue', () => { expect.objectContaining({ variables: { oldPassword: 'supersecret', - newPassword: 'superdupersecret', - confirmPassword: 'superdupersecret', + password: 'superdupersecret', + passwordConfirmation: 'superdupersecret', }, }), ) @@ -135,8 +135,8 @@ describe('ChangePassword.vue', () => { /* describe('mutation rejects', () => { beforeEach(async () => { await wrapper.find('input#oldPassword').setValue('supersecret') - await wrapper.find('input#newPassword').setValue('supersecret') - await wrapper.find('input#confirmPassword').setValue('supersecret') + await wrapper.find('input#password').setValue('supersecret') + await wrapper.find('input#passwordConfirmation').setValue('supersecret') }) it('displays error message', async () => { diff --git a/webapp/components/Password/Change.vue b/webapp/components/Password/Change.vue index 63c797157..dabc53d6f 100644 --- a/webapp/components/Password/Change.vue +++ b/webapp/components/Password/Change.vue @@ -1,12 +1,6 @@