fix some bugs

This commit is contained in:
Nolan Lawson 2018-03-05 21:58:29 -08:00
parent 19d5d9aaae
commit 32e47a0bb7
3 changed files with 32 additions and 9 deletions

View file

@ -12,6 +12,20 @@ export const actions = times(30, i => ({
text: 'hello world' text: 'hello world'
} }
}, },
{
user: 'admin',
post: {
text: '@foobar hello foobar',
privacy: 'unlisted'
}
},
{
user: 'foobar',
post: {
text: '@admin hello admin',
privacy: 'unlisted'
}
},
{ {
user: 'foobar', user: 'foobar',
post: { post: {
@ -87,8 +101,8 @@ export const actions = times(30, i => ({
{ {
user: 'admin', user: 'admin',
post: { post: {
text: '@foobar hello foobar', text: '@foobar direct',
privacy: 'unlisted' privacy: 'direct'
} }
}, },
{ {
@ -150,6 +164,10 @@ export const actions = times(30, i => ({
user: 'admin', user: 'admin',
boost: 1 boost: 1
}, },
{
user: 'admin',
boost: 2
},
{ {
user: 'admin', user: 'admin',
favorite: 2 favorite: 2
@ -159,7 +177,7 @@ export const actions = times(30, i => ({
post: { post: {
internalId: 5, internalId: 5,
text: 'pinned toot 1', text: 'pinned toot 1',
privacy: 'private' privacy: 'unlisted'
} }
}, },
{ {
@ -167,7 +185,7 @@ export const actions = times(30, i => ({
post: { post: {
internalId: 6, internalId: 6,
text: 'pinned toot 2', text: 'pinned toot 2',
privacy: 'private' privacy: 'unlisted'
} }
} }
]).concat(times(25, i => ({ ]).concat(times(25, i => ({
@ -175,7 +193,7 @@ export const actions = times(30, i => ({
post: { post: {
internalId: 100 + i, internalId: 100 + i,
text: 'unlisted thread ' + (i + 1), text: 'unlisted thread ' + (i + 1),
privacy: 'private', privacy: 'unlisted',
inReplyTo: i > 0 && (100 + i) inReplyTo: i > 0 && (100 + i)
} }
}))).concat([ }))).concat([
@ -187,6 +205,10 @@ export const actions = times(30, i => ({
user: 'quux', user: 'quux',
pin: 6 pin: 6
}, },
{
user: 'admin',
boost: 5
},
{ {
user: 'admin', user: 'admin',
favorite: 5 favorite: 5
@ -203,21 +225,21 @@ export const actions = times(30, i => ({
user: 'ExternalLinks', user: 'ExternalLinks',
post: { post: {
text: 'here are some hashtags: #kitten #kitties', text: 'here are some hashtags: #kitten #kitties',
privacy: 'private' privacy: 'unlisted'
} }
}, },
{ {
user: 'ExternalLinks', user: 'ExternalLinks',
post: { post: {
text: 'here are some external links: https://joinmastodon.org https://github.com/tootsuite/mastodon', text: 'here are some external links: https://joinmastodon.org https://github.com/tootsuite/mastodon',
privacy: 'private' privacy: 'unlisted'
} }
}, },
{ {
user: 'ExternalLinks', user: 'ExternalLinks',
post: { post: {
text: 'here are some users: @admin @quux', text: 'here are some users: @admin @quux',
privacy: 'private' privacy: 'unlisted'
} }
} }
]) ])

View file

@ -52,6 +52,7 @@ export async function restoreMastodonData () {
} else if (action.boost) { } else if (action.boost) {
await reblogStatus('localhost:3000', accessToken, internalIdsToIds[action.boost]) await reblogStatus('localhost:3000', accessToken, internalIdsToIds[action.boost])
} }
await new Promise(resolve => setTimeout(resolve, 2000))
} }
console.log('Restored mastodon data') console.log('Restored mastodon data')
} }

View file

@ -75,8 +75,8 @@ async function main () {
await setupMastodonDatabase() await setupMastodonDatabase()
await runMastodon() await runMastodon()
await waitForMastodonApiToStart() await waitForMastodonApiToStart()
await waitForMastodonUiToStart()
await restoreMastodonData() await restoreMastodonData()
await waitForMastodonUiToStart()
} }
process.on('SIGINT', function () { process.on('SIGINT', function () {