Skip to content

Commit 8553542

Browse files
authored
chore: update test entry IDs in TestDefaults for failing integ tests [DX-198] (#2670)
* chore: update test entry IDs in TestDefaults for failing integ tests * chore: replace hardcoded entry IDs with TestDefaults in entry integration tests * style: format code for better readability in entry references integration test * chore: remove .only oopssie
1 parent ca7913d commit 8553542

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

test/defaults.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ export const TestDefaults = {
66
withCrossSpaceReferenceId: 'test-content-type33324244',
77
},
88
entry: {
9-
testEntryId: '5ETMRzkl9KM4omyMwKAOki',
9+
testEntryId: '3Z76Riu91MIwPWIMG93LNb',
1010
/** Used in the entry references specs */
1111
testEntryReferenceId: '3ZgkmNQJxGjO9TUcnDgNQC',
1212
/** Used in Release specs */
13-
testEntryReleasesId: '11NZX9PeFBvuQPc6LyCRpP',
13+
testEntryReleasesId: '7pw3xjgbpE41JJrenBessW',
1414
/** Used in BulkAction specs */
15-
testEntryBulkActionId: '375PMdQrwWOsifPJYP5Bb9',
15+
testEntryBulkActionId: '6THqkC8vpDqAFtomRQazPu',
1616
},
1717
userId: '0DdCYLZI33Oe1uZ0FLpCzw',
1818
userEmail: '[email protected]',

test/integration/entry-integration.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('Entry Api', () => {
3232
})
3333

3434
test('Gets entry', async () => {
35-
return environment.getEntry('5ETMRzkl9KM4omyMwKAOki').then((response) => {
35+
return environment.getEntry(TestDefaults.entry.testEntryId).then((response) => {
3636
expect(response.sys, 'sys').to.be.ok
3737
expect(response.fields, 'fields').to.be.ok
3838
})
@@ -45,7 +45,7 @@ describe('Entry Api', () => {
4545
})
4646
})
4747
test('Gets Entry snapshots', async () => {
48-
return environment.getEntry('5ETMRzkl9KM4omyMwKAOki').then((entry) => {
48+
return environment.getEntry(TestDefaults.entry.testEntryId).then((entry) => {
4949
return entry.getSnapshots().then((response) => {
5050
expect(response, 'entry snapshots').ok
5151
expect(response.items, 'entry snapshots items').ok
@@ -300,6 +300,7 @@ describe('Entry Api', () => {
300300
'dog',
301301
'human',
302302
'kangaroo',
303+
'test-content-type33324244',
303304
'testEntryReferences',
304305
],
305306
'orders'

test/integration/entry-references-integration.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { Space } from '../../lib/entities/space'
55
import { TestDefaults } from '../defaults'
66
import { getDefaultSpace, initPlainClient, timeoutToCalmRateLimiting } from '../helpers'
77

8-
const ENTRY_WITH_REFERENCES_ID = TestDefaults.entry.testEntryReferenceId
98
const WRONG_ENTRY_ID = '123123XD'
109

1110
describe('Entry References', () => {
@@ -23,13 +22,16 @@ describe('Entry References', () => {
2322
let entryWithReferences: any
2423

2524
beforeAll(async () => {
26-
entryWithReferences = await testEnvironment.getEntryReferences(ENTRY_WITH_REFERENCES_ID, {
27-
include: 2,
28-
})
25+
entryWithReferences = await testEnvironment.getEntryReferences(
26+
TestDefaults.entry.testEntryReferenceId,
27+
{
28+
include: 2,
29+
}
30+
)
2931
})
3032

3133
it('Get the correct entry with references', () => {
32-
expect(entryWithReferences.items[0].sys.id).toBe(ENTRY_WITH_REFERENCES_ID)
34+
expect(entryWithReferences.items[0].sys.id).toBe(TestDefaults.entry.testEntryReferenceId)
3335
expect(entryWithReferences.includes).not.toBeUndefined()
3436
expect(entryWithReferences.includes.Entry.length).toBeGreaterThan(0)
3537
})
@@ -62,7 +64,7 @@ describe('Entry References', () => {
6264
plainClient = initPlainClient(defaultParams)
6365

6466
entry = await plainClient.entry.get({
65-
entryId: ENTRY_WITH_REFERENCES_ID,
67+
entryId: TestDefaults.entry.testEntryReferenceId,
6668
})
6769

6870
entryWithReferences = await plainClient.entry.references({
@@ -72,7 +74,7 @@ describe('Entry References', () => {
7274
})
7375

7476
it('Get the correct entry with references', () => {
75-
expect(entryWithReferences.items[0].sys.id).toBe(ENTRY_WITH_REFERENCES_ID)
77+
expect(entryWithReferences.items[0].sys.id).toBe(TestDefaults.entry.testEntryReferenceId)
7678
expect(entryWithReferences.includes).not.toBeUndefined()
7779
expect(entryWithReferences.includes.Entry.length).toBeGreaterThan(0)
7880
})

0 commit comments

Comments
 (0)