Browse Source

post-migration assertions via typescript: counters not reset

ignazio 3 years ago
parent
commit
46b5b31e0a

+ 0 - 1
tests/network-tests/run-migration-tests.sh

@@ -269,7 +269,6 @@ function post_migration_cli() {
   yarn joystream-cli content:videos 1
 }
 
-
 # entrypoint
 function main {
     # Section A: pre migration

+ 26 - 0
tests/network-tests/src/misc/postMigrationAssertionsFlow.ts

@@ -0,0 +1,26 @@
+import { assert } from 'chai'
+import { FlowProps } from '../Flow'
+import { FixtureRunner } from '../Fixture'
+import { extendDebug } from '../Debugger'
+
+export default async function mockContent({ api }: FlowProps): Promise<void> {
+    const debug = extendDebug('flow:postMigrationAssertions')
+    debug('Started')
+
+    // check that counters haven't been re-set        
+    debug('Checking that Video, Channel, Categories  counters have not been re-set')
+
+    const nextVideoCategoryId = await api.query.content.nextVideoCategoryId()
+    const nextChannelCategoryId = await api.query.content.nextVideoCategoryId()
+    const nextVideoId = await api.query.content.nextVideoId()
+    const nextChannelId = await api.query.content.nextChannelId()
+
+
+    assert(nextVideoCategoryId.toNumber() > 1);
+    assert(nextChannelCategoryId.toNumber() > 1);
+    assert(nextVideoId.toNumber() > 1);
+    assert(nextChannelId.toNumber() > 1);
+
+
+    debug('Done')
+}