mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
Reconsider test indentation
This commit is contained in:
parent
b2ec20ed2c
commit
195e9fdb7c
1 changed files with 398 additions and 419 deletions
|
|
@ -18,8 +18,7 @@ function testError (t, query, handler) {
|
|||
})
|
||||
}
|
||||
|
||||
test('schema has a node field', testData,
|
||||
`
|
||||
test('schema has a node field', testData, `
|
||||
{
|
||||
node(id: "UmVsZWFzZUdyb3VwOmUzN2QyNzQwLTQ1MDMtNGUzZi1hYjZkLWU2MjJhMjVlOTY0ZA==") {
|
||||
__typename
|
||||
|
|
@ -35,11 +34,9 @@ test('schema has a node field', testData,
|
|||
mbid: 'e37d2740-4503-4e3f-ab6d-e622a25e964d'
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
test('schema has a lookup query', testData,
|
||||
`
|
||||
test('schema has a lookup query', testData, `
|
||||
{
|
||||
lookup {
|
||||
artist (mbid: "c8da2e40-bd28-4d4e-813a-bd2f51958ba8") {
|
||||
|
|
@ -61,8 +58,7 @@ test('schema has a lookup query', testData,
|
|||
})
|
||||
})
|
||||
|
||||
test('schema has a search query', testData,
|
||||
`
|
||||
test('schema has a search query', testData, `
|
||||
{
|
||||
search {
|
||||
recordings (query: "Burn the Witch") {
|
||||
|
|
@ -84,8 +80,7 @@ test('schema has a search query', testData,
|
|||
recordings.edges.forEach(edge => t.true(edge.score > 0))
|
||||
})
|
||||
|
||||
test('schema has a browse query', testData,
|
||||
`
|
||||
test('schema has a browse query', testData, `
|
||||
{
|
||||
browse {
|
||||
releaseGroups (artist: "c8da2e40-bd28-4d4e-813a-bd2f51958ba8") {
|
||||
|
|
@ -113,8 +108,7 @@ test('schema has a browse query', testData,
|
|||
releaseGroups.edges.forEach(edge => t.truthy(edge.node.title))
|
||||
})
|
||||
|
||||
test('supports deeply nested queries', testData,
|
||||
`
|
||||
test('supports deeply nested queries', testData, `
|
||||
query AppleRecordsMarriages {
|
||||
search {
|
||||
labels(query: "Apple Records", first: 1) {
|
||||
|
|
@ -188,8 +182,7 @@ test('supports deeply nested queries', testData,
|
|||
t.is(labels.edges[0].node.releases.edges.length, 1)
|
||||
})
|
||||
|
||||
test('throws an error if given a malformed MBID', testError,
|
||||
`
|
||||
test('throws an error if given a malformed MBID', testError, `
|
||||
{
|
||||
lookup {
|
||||
artist(mbid: "ABC123") {
|
||||
|
|
@ -203,8 +196,7 @@ test('throws an error if given a malformed MBID', testError,
|
|||
t.is(err.message, 'Malformed MBID: ABC123')
|
||||
})
|
||||
|
||||
test('Artist beginArea/endArea pulls from begin_area/end_area for lookup queries', testData,
|
||||
`
|
||||
test('Artist beginArea/endArea pulls from begin_area/end_area for lookup queries', testData, `
|
||||
{
|
||||
lookup {
|
||||
artist(mbid: "65314b12-0e08-43fa-ba33-baaa7b874c15") {
|
||||
|
|
@ -223,8 +215,7 @@ test('Artist beginArea/endArea pulls from begin_area/end_area for lookup queries
|
|||
t.is(artist.endArea.name, 'Los Angeles')
|
||||
})
|
||||
|
||||
test('Artist beginArea/endArea pull from begin_area/end_area for browse queries', testData,
|
||||
`
|
||||
test('Artist beginArea/endArea pull from begin_area/end_area for browse queries', testData, `
|
||||
{
|
||||
browse {
|
||||
artists(area: "3f504d54-c40c-487d-bc16-c1990eac887f") {
|
||||
|
|
@ -248,8 +239,7 @@ test('Artist beginArea/endArea pull from begin_area/end_area for browse queries'
|
|||
t.true(artists.some(artist => artist.endArea))
|
||||
})
|
||||
|
||||
test('Artist beginArea/endArea pulls from begin-area/end-area for search queries', testData,
|
||||
`
|
||||
test('Artist beginArea/endArea pulls from begin-area/end-area for search queries', testData, `
|
||||
{
|
||||
search {
|
||||
artists(query: "Leonard Cohen", first: 1) {
|
||||
|
|
@ -273,8 +263,7 @@ test('Artist beginArea/endArea pulls from begin-area/end-area for search queries
|
|||
t.is(artists[0].endArea.name, 'Los Angeles')
|
||||
})
|
||||
|
||||
test('relationships filter by type', testData,
|
||||
`
|
||||
test('relationships filter by type', testData, `
|
||||
{
|
||||
lookup {
|
||||
artist(mbid: "65314b12-0e08-43fa-ba33-baaa7b874c15") {
|
||||
|
|
@ -332,8 +321,7 @@ test('relationships filter by type', testData,
|
|||
})
|
||||
})
|
||||
|
||||
test('Area maps iso-3166-1-codes to isoCodes', testData,
|
||||
`
|
||||
test('Area maps iso-3166-1-codes to isoCodes', testData, `
|
||||
{
|
||||
lookup {
|
||||
area(mbid: "489ce91b-6658-3307-9877-795b68554c98") {
|
||||
|
|
@ -346,8 +334,7 @@ test('Area maps iso-3166-1-codes to isoCodes', testData,
|
|||
t.deepEqual(data.lookup.area.isoCodes, ['US'])
|
||||
})
|
||||
|
||||
test('Alias locales use the Locale scalar', testData,
|
||||
`
|
||||
test('Alias locales use the Locale scalar', testData, `
|
||||
{
|
||||
lookup {
|
||||
artist(mbid: "f99b7d67-4e63-4678-aa66-4c6ac0f7d24a") {
|
||||
|
|
@ -364,8 +351,7 @@ test('Alias locales use the Locale scalar', testData,
|
|||
t.is(aliases.find(alias => alias.locale === 'ko').name, '싸이')
|
||||
})
|
||||
|
||||
test('Work ISWCs use the ISWC scalar', testData,
|
||||
`
|
||||
test('Work ISWCs use the ISWC scalar', testData, `
|
||||
{
|
||||
lookup {
|
||||
work(mbid: "ef7d0814-da6a-32f5-a600-ff81cffd1aed") {
|
||||
|
|
@ -380,8 +366,7 @@ test('Work ISWCs use the ISWC scalar', testData,
|
|||
t.deepEqual(work.iswcs, ['T-900.755.682-3'])
|
||||
})
|
||||
|
||||
test('URLs may be looked up by resource', testData,
|
||||
`
|
||||
test('URLs may be looked up by resource', testData, `
|
||||
{
|
||||
lookup {
|
||||
url(resource: "http://www.nirvana.com/") {
|
||||
|
|
@ -396,8 +381,7 @@ test('URLs may be looked up by resource', testData,
|
|||
t.is(url.resource, 'http://www.nirvana.com/')
|
||||
})
|
||||
|
||||
test('throws an error if given a malformed URLString', testError,
|
||||
`
|
||||
test('throws an error if given a malformed URLString', testError, `
|
||||
{
|
||||
lookup {
|
||||
url(resource: "http:foo") {
|
||||
|
|
@ -412,8 +396,7 @@ test('throws an error if given a malformed URLString', testError,
|
|||
t.is(err.message, 'Malformed URL: http:foo')
|
||||
})
|
||||
|
||||
test('Release groups can be browsed by type', testData,
|
||||
`
|
||||
test('Release groups can be browsed by type', testData, `
|
||||
{
|
||||
browse {
|
||||
releaseGroups(artist: "5b11f4ce-a62d-471e-81fc-a69a8278c7da", type: EP) {
|
||||
|
|
@ -431,8 +414,7 @@ test('Release groups can be browsed by type', testData,
|
|||
releaseGroups.forEach(releaseGroup => t.is(releaseGroup.primaryType, 'EP'))
|
||||
})
|
||||
|
||||
test('Releases can be browsed by type and status', testData,
|
||||
`
|
||||
test('Releases can be browsed by type and status', testData, `
|
||||
{
|
||||
browse {
|
||||
releases(artist: "5b11f4ce-a62d-471e-81fc-a69a8278c7da", type: EP, status: BOOTLEG) {
|
||||
|
|
@ -450,8 +432,7 @@ test('Releases can be browsed by type and status', testData,
|
|||
releases.forEach(release => t.is(release.status, 'BOOTLEG'))
|
||||
})
|
||||
|
||||
test('Releases have an ASIN field', testData,
|
||||
`
|
||||
test('Releases have an ASIN field', testData, `
|
||||
{
|
||||
lookup {
|
||||
release(mbid: "d5cdb7fd-c7e9-460a-9549-8a369655cc52") {
|
||||
|
|
@ -464,8 +445,7 @@ test('Releases have an ASIN field', testData,
|
|||
t.is(release.asin, 'B01KN6XDS6')
|
||||
})
|
||||
|
||||
test('Artists have a list of ISNIs and IPIs', testData,
|
||||
`
|
||||
test('Artists have a list of ISNIs and IPIs', testData, `
|
||||
{
|
||||
lookup {
|
||||
artist(mbid: "65314b12-0e08-43fa-ba33-baaa7b874c15") {
|
||||
|
|
@ -480,8 +460,7 @@ test('Artists have a list of ISNIs and IPIs', testData,
|
|||
t.deepEqual(artist.isnis, ['0000000110273481'])
|
||||
})
|
||||
|
||||
test('artistCredits is an alias for artistCredit', testData,
|
||||
`
|
||||
test('artistCredits is an alias for artistCredit', testData, `
|
||||
{
|
||||
lookup {
|
||||
recording(mbid: "07649758-09c8-4d70-bc6f-5c37ab36334d") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue