Skip to content

Commit

Permalink
test(integration): adjust test values to new test space
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Rötsch committed Oct 30, 2017
1 parent 2ae631a commit c587b84
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
28 changes: 16 additions & 12 deletions test/integration/export-cli-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,25 @@ test('It should export space properly when running as a cli', (t) => {
app()
.run(` --space-id ${spaceId} --management-token ${managementToken} --export-dir ${tmpFolder}`)
.stdout(/Exported entities/)
.stdout(/Content Types {13}| 3/)
.stdout(/Editor Interfaces {9}| 3/)
.stdout(/Entries {19}| 6/)
.stdout(/Assets {20}| 6/)
.stdout(/Locales {19}| 1/)
.stdout(/Webhooks {18}| 0/)
.stdout(/Roles {21}| 7/)
.end(() => {
.stdout(/Content Types +| 2/)
.stdout(/Editor Interfaces +| 2/)
.stdout(/Entries +| 4/)
.stdout(/Assets +| 4/)
.stdout(/Locales +| 1/)
.stdout(/Webhooks +| 0/)
.stdout(/Roles +| 7/)
.end((error) => {
if (error) {
console.error(error)
t.fail('Should not throw error')
}
const fileList = fs.readdirSync(tmpFolder)
filePath = fileList[0] // we only have one file
const exportedFile = JSON.parse(fs.readFileSync(join(tmpFolder, filePath)))
t.equal(exportedFile.contentTypes.length, 3, '3 content types should be exported')
t.equal(exportedFile.editorInterfaces.length, 3, '3 editor interfaces should be exported')
t.equal(exportedFile.entries.length, 6, '6 entries should be exported')
t.equal(exportedFile.assets.length, 6, '6 assets should be exported')
t.equal(exportedFile.contentTypes.length, 2, '2 content types should be exported')
t.equal(exportedFile.editorInterfaces.length, 2, '2 editor interfaces should be exported')
t.equal(exportedFile.entries.length, 4, '4 entries should be exported')
t.equal(exportedFile.assets.length, 4, '4 assets should be exported')
t.equal(exportedFile.locales.length, 1, '1 locale should be exported')
t.equal(exportedFile.webhooks.length, 0, '0 webhooks should be exported')
t.equal(exportedFile.roles.length, 7, '7 roles should be exported')
Expand Down
8 changes: 4 additions & 4 deletions test/integration/export-lib-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ test('It should export space when used as a library', (t) => {
return runContentfulExport({spaceId, managementToken, saveFile: false})
.then((content) => {
t.ok(content)
t.equal(content.contentTypes.length, 3, '3 content types should be exported')
t.equal(content.editorInterfaces.length, 3, '3 editor interfaces should be exported')
t.equal(content.entries.length, 6, '6 entries should be exported')
t.equal(content.assets.length, 6, '6 assets should be exported')
t.equal(content.contentTypes.length, 2, '2 content types should be exported')
t.equal(content.editorInterfaces.length, 2, '2 editor interfaces should be exported')
t.equal(content.entries.length, 4, '4 entries should be exported')
t.equal(content.assets.length, 4, '4 assets should be exported')
t.equal(content.locales.length, 1, '1 locale should be exported')
t.equal(content.webhooks.length, 0, '0 webhooks should be exported')
t.equal(content.roles.length, 7, '7 roles should be exported')
Expand Down

0 comments on commit c587b84

Please sign in to comment.