Skip to content

Commit

Permalink
Merge branch 'DNmHL-kulla-2024-06-09-12-05' into 1SWyC-kulla-2024-06-…
Browse files Browse the repository at this point in the history
…07-22-08
  • Loading branch information
hugotiburtino authored Jun 14, 2024
2 parents dccdffe + 42fde67 commit 2a16e84
Show file tree
Hide file tree
Showing 52 changed files with 1,345 additions and 2,203 deletions.
20 changes: 20 additions & 0 deletions __fixtures__/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,26 @@ const courseMetadata = {
},
],
creator: [
{
id: 'https://serlo.org/15473',
name: '125f3e12',
type: 'Person',
affiliation: {
id: 'https://serlo.org/organization',
name: 'Serlo Education e.V.',
type: 'Organization',
},
},
{
id: 'https://serlo.org/15491',
name: '125f4a84',
type: 'Person',
affiliation: {
id: 'https://serlo.org/organization',
name: 'Serlo Education e.V.',
type: 'Organization',
},
},
{
id: 'https://serlo.org/324',
name: '122d486a',
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/uuid/applet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const applet: Model<'Applet'> = {
trashed: false,
instance: Instance.En,
alias: '/math/35596/example-applet',
date: '2014-03-01T20:45:56Z',
date: '2020-01-29T17:47:19.000Z',
currentRevisionId: 35597,
revisionIds: [35597],
licenseId,
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/uuid/article.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const article: ArticleWithAllFieldsDefined = {
trashed: false,
instance: Instance.De,
alias: '/mathe/1855/parabel',
date: '2014-03-01T20:45:56Z',
date: '2014-03-01T20:45:56.000Z',
currentRevisionId: 30674,
licenseId,
taxonomyTermIds: [5],
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/uuid/course-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const coursePage: Model<'CoursePage'> = {
trashed: false,
instance: Instance.De,
alias: '/mathe/18521/startseite',
date: '2014-03-01T20:45:56Z',
date: '2014-03-17T12:24:54.000Z',
currentRevisionId: 19277,
revisionIds: [19277],
licenseId,
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/uuid/course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const course: Model<'Course'> = {
trashed: false,
instance: Instance.De,
alias: '/mathe/18514/überblick-zum-satz-des-pythagoras',
date: '2014-03-01T20:45:56Z',
date: '2014-03-17T12:22:17.000Z',
currentRevisionId: 30713,
revisionIds: [30713],
licenseId,
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/uuid/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const event: Model<'Event'> = {
trashed: false,
instance: Instance.De,
alias: '/mathe/35554/beispielveranstaltung',
date: '2014-03-01T20:45:56Z',
date: '2019-12-02T22:40:41.000Z',
currentRevisionId: 35555,
revisionIds: [35555],
licenseId,
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/uuid/exercise-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const exerciseGroup: Model<'ExerciseGroup'> = {
trashed: false,
instance: Instance.De,
alias: '/mathe/2217/2217',
date: '2014-03-01T20:45:56Z',
date: '2014-03-01T20:54:51.000Z',
currentRevisionId: 2218,
revisionIds: [2218],
licenseId,
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/uuid/exercise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const exercise: Model<'Exercise'> = {
trashed: false,
instance: Instance.De,
alias: '/mathe/29637/29637',
date: '2014-03-01T20:45:56Z',
date: '2014-09-08T10:42:33.000Z',
currentRevisionId: 29638,
revisionIds: [29638],
licenseId,
Expand Down
5 changes: 0 additions & 5 deletions __fixtures__/uuid/taxonomy-term.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const taxonomyTermRoot: Model<'TaxonomyTerm'> = {
description: null,
weight: 1,
parentId: null,
taxonomyId: 1,
childrenIds: [5],
}

Expand All @@ -28,7 +27,6 @@ export const taxonomyTermSubject: Model<'TaxonomyTerm'> = {
description: null,
weight: 2,
parentId: taxonomyTermRoot.id,
taxonomyId: 3,
childrenIds: [16048],
}

Expand All @@ -42,7 +40,6 @@ export const taxonomyTermCurriculumTopic: Model<'TaxonomyTerm'> = {
name: 'name',
description: 'description',
weight: 3,
taxonomyId: 11,
parentId: taxonomyTermSubject.id,
childrenIds: [1855],
}
Expand All @@ -57,7 +54,6 @@ export const taxonomyTermTopic: Model<'TaxonomyTerm'> = {
name: 'Geometrie',
description: null,
weight: 6,
taxonomyId: 4,
parentId: 5,
childrenIds: [
23453, 1454, 1394, 24518, 1380, 24410, 24422, 1381, 1383, 1300, 1413,
Expand All @@ -74,7 +70,6 @@ export const taxonomyTermTopicFolder: Model<'TaxonomyTerm'> = {
name: 'Aufgaben zu einfachen Potenzen',
description: '',
weight: 1,
taxonomyId: 9,
parentId: 1288,
childrenIds: [10385, 6925, 6921, 6933, 6917, 7085],
}
2 changes: 1 addition & 1 deletion __fixtures__/uuid/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const video: Model<'Video'> = {
trashed: false,
instance: Instance.De,
alias: '/mathe/32321/schriftliche-addition',
date: '2014-10-15T12:49:12+02:00',
date: '2014-10-15T12:49:12.000Z',
currentRevisionId: 32322,
revisionIds: [32322],
licenseId,
Expand Down
5 changes: 0 additions & 5 deletions __tests__/__utils__/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ const ForDefinitions = {
given('UuidQuery').withPayload({ id: uuid.id }).returns(uuid)
}
},
UnrevisedEntitiesQuery(entities: Model<'AbstractEntity'>[]) {
given('UnrevisedEntitiesQuery')
.withPayload({})
.returns({ unrevisedEntityIds: entities.map((entity) => entity.id) })
},
DeletedEntitiesQuery(entities: Model<'AbstractEntity'>[]) {
given('UuidQuery').for(
entities.map((entity) => {
Expand Down
86 changes: 85 additions & 1 deletion __tests__/__utils__/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,91 @@ import gql from 'graphql-tag'

import { Client } from './assertions'

export const entityQuery = new Client().prepareQuery({
query: gql`
query ($id: Int!) {
uuid(id: $id) {
... on AbstractUuid {
alias
}
... on AbstractEntity {
__typename
id
instance
trashed
date
title
licenseId
currentRevision {
id
}
revisions {
nodes {
id
}
}
}
... on AbstractTaxonomyTermChild {
taxonomyTerms {
nodes {
id
}
}
}
}
}
`,
variables: { id: 27801 },
})

export const entityRevisionQuery = new Client().prepareQuery({
query: gql`
query ($id: Int!) {
uuid(id: $id) {
... on AbstractUuid {
alias
}
... on AbstractEntityRevision {
__typename
id
author {
id
}
trashed
date
repository {
id
}
title
content
changes
metaTitle
metaDescription
url
}
}
}
`,
variables: { id: 35296 },
})

export const userQueryUnrevisedEntities = new Client().prepareQuery({
query: gql`
query ($id: Int!) {
uuid(id: $id) {
... on User {
unrevisedEntities {
nodes {
id
}
}
}
}
}
`,
variables: { id: 299 },
})

export const taxonomyTermQuery = new Client().prepareQuery({
query: gql`
query ($id: Int!) {
Expand All @@ -17,7 +102,6 @@ export const taxonomyTermQuery = new Client().prepareQuery({
name
description
weight
taxonomyId
path {
id
}
Expand Down
Loading

0 comments on commit 2a16e84

Please sign in to comment.