Fix tests conflicting

This commit is contained in:
Alexandre Bodin 2021-08-17 18:54:20 +02:00
parent fd86d1926f
commit a041d76d8a

View File

@ -23,7 +23,7 @@ const uploadImg = () => {
const components = { const components = {
singleMedia: { singleMedia: {
name: 'single-media', name: 'one-media',
attributes: { attributes: {
media: { media: {
type: 'media', type: 'media',
@ -31,7 +31,7 @@ const components = {
}, },
}, },
multipleMedia: { multipleMedia: {
name: 'multiple-media', name: 'many-media',
attributes: { attributes: {
media: { media: {
type: 'media', type: 'media',
@ -44,11 +44,11 @@ const components = {
attributes: { attributes: {
singleMedia: { singleMedia: {
type: 'component', type: 'component',
component: 'default.single-media', component: 'default.one-media',
}, },
multipleMedia: { multipleMedia: {
type: 'component', type: 'component',
component: 'default.multiple-media', component: 'default.many-media',
}, },
}, },
}, },
@ -59,7 +59,7 @@ const ct = {
attributes: { attributes: {
field: { field: {
type: 'dynamiczone', type: 'dynamiczone',
components: ['default.single-media', 'default.multiple-media', 'default.with-nested'], components: ['default.one-media', 'default.many-media', 'default.with-nested'],
}, },
}, },
}; };
@ -101,11 +101,11 @@ describe('Not required dynamiczone', () => {
body: { body: {
field: [ field: [
{ {
__component: 'default.single-media', __component: 'default.one-media',
media: mediaId, media: mediaId,
}, },
{ {
__component: 'default.multiple-media', __component: 'default.many-media',
media: [mediaId, mediaId], media: [mediaId, mediaId],
}, },
], ],
@ -122,7 +122,7 @@ describe('Not required dynamiczone', () => {
field: [ field: [
{ {
id: expect.anything(), id: expect.anything(),
__component: 'default.single-media', __component: 'default.one-media',
media: { media: {
id: mediaId, id: mediaId,
url: expect.any(String), url: expect.any(String),
@ -130,7 +130,7 @@ describe('Not required dynamiczone', () => {
}, },
{ {
id: expect.anything(), id: expect.anything(),
__component: 'default.multiple-media', __component: 'default.many-media',
media: expect.arrayContaining([ media: expect.arrayContaining([
expect.objectContaining({ expect.objectContaining({
id: mediaId, id: mediaId,
@ -155,11 +155,11 @@ describe('Not required dynamiczone', () => {
body: { body: {
field: [ field: [
{ {
__component: 'default.single-media', __component: 'default.one-media',
media: mediaId, media: mediaId,
}, },
{ {
__component: 'default.multiple-media', __component: 'default.many-media',
media: [mediaId, mediaId], media: [mediaId, mediaId],
}, },
], ],
@ -182,11 +182,11 @@ describe('Not required dynamiczone', () => {
body: { body: {
field: [ field: [
{ {
__component: 'default.single-media', __component: 'default.one-media',
media: newMediaId, media: newMediaId,
}, },
{ {
__component: 'default.multiple-media', __component: 'default.many-media',
media: [newMediaId, newMediaId], media: [newMediaId, newMediaId],
}, },
], ],
@ -201,7 +201,7 @@ describe('Not required dynamiczone', () => {
field: [ field: [
{ {
id: expect.anything(), id: expect.anything(),
__component: 'default.single-media', __component: 'default.one-media',
media: { media: {
id: newMediaId, id: newMediaId,
url: expect.any(String), url: expect.any(String),
@ -209,7 +209,7 @@ describe('Not required dynamiczone', () => {
}, },
{ {
id: expect.anything(), id: expect.anything(),
__component: 'default.multiple-media', __component: 'default.many-media',
media: expect.arrayContaining([ media: expect.arrayContaining([
expect.objectContaining({ expect.objectContaining({
id: newMediaId, id: newMediaId,
@ -234,11 +234,11 @@ describe('Not required dynamiczone', () => {
body: { body: {
field: [ field: [
{ {
__component: 'default.single-media', __component: 'default.one-media',
media: mediaId, media: mediaId,
}, },
{ {
__component: 'default.multiple-media', __component: 'default.many-media',
media: [mediaId, mediaId], media: [mediaId, mediaId],
}, },
], ],
@ -263,7 +263,7 @@ describe('Not required dynamiczone', () => {
field: [ field: [
{ {
id: expect.anything(), id: expect.anything(),
__component: 'default.single-media', __component: 'default.one-media',
media: { media: {
id: mediaId, id: mediaId,
url: expect.any(String), url: expect.any(String),
@ -271,7 +271,7 @@ describe('Not required dynamiczone', () => {
}, },
{ {
id: expect.anything(), id: expect.anything(),
__component: 'default.multiple-media', __component: 'default.many-media',
media: expect.arrayContaining([ media: expect.arrayContaining([
expect.objectContaining({ expect.objectContaining({
id: mediaId, id: mediaId,