diff --git a/app/views/pages/index.liquid b/app/views/pages/index.liquid index 01a2e94..3901711 100644 --- a/app/views/pages/index.liquid +++ b/app/views/pages/index.liquid @@ -1,8 +1,8 @@ {% liquid function current_profile = 'modules/user/helpers/current_profile' if current_profile.user - function profiles = 'modules/user/queries/profiles/search', limit: 20, not_ids: null, uuid: null, id: null, ids: null, first_name: null, last_name: null, user_id: null, query: null, emails: null, sort: null + function profiles = 'modules/user/queries/profiles/search', limit: 50, not_ids: null, uuid: null, id: null, ids: null, first_name: null, last_name: null, user_id: null, query: null, emails: null, sort: null endif render 'index', current_profile: current_profile, profiles: profiles -%} +%} \ No newline at end of file diff --git a/tests/data/seed/seed.sh b/tests/data/seed/seed.sh index 0de5048..5f1ab9c 100755 --- a/tests/data/seed/seed.sh +++ b/tests/data/seed/seed.sh @@ -6,5 +6,8 @@ POS_ENV="${1:-$DEFAULT_ENV}" pos-cli data clean $POS_ENV --auto-confirm --include-schema pos-cli deploy $POS_ENV +cd ./tests/post_import -pos-cli data import --path=./tests/data/seed/data.zip --zip $POS_ENV \ No newline at end of file +env CONFIG_FILE_PATH=./../../.pos pos-cli data import --path=./../data/seed/data.zip --zip $POS_ENV +env CONFIG_FILE_PATH=./../../.pos pos-cli deploy -p $POS_ENV +cd - \ No newline at end of file diff --git a/tests/messaging.spec.ts b/tests/messaging.spec.ts index 812aaac..6e7a37a 100644 --- a/tests/messaging.spec.ts +++ b/tests/messaging.spec.ts @@ -149,4 +149,21 @@ test.describe('Testing messaging', () => { await expect(page.locator('header').getByText(users.test7.fullName)).not.toBeVisible(); }); + + test(`regression: old conversation opens correct chat from people list`, async ({ browser }) => { + let context: BrowserContext | null = null; + let page: Page; + + const receiverFullName = "Dummy10 User"; + + ({ context, page } = await switchContext(context, browser, `tests/.auth/${users.test6.email}.json`)); + + const peoplePage = new PeoplePage(page); + const inboxPage = new InboxPage(page); + + await peoplePage.goto(); + + const isChatOpened = await inboxPage.isChatOpened(receiverFullName); + expect(isChatOpened).toBe(true); + }) }); \ No newline at end of file diff --git a/tests/post_import/app/migrations/20250805174858_create_dummy_users.liquid b/tests/post_import/app/migrations/20250805174858_create_dummy_users.liquid new file mode 100644 index 0000000..2129104 --- /dev/null +++ b/tests/post_import/app/migrations/20250805174858_create_dummy_users.liquid @@ -0,0 +1,29 @@ +{% liquid + comment + create 40 'dummy users' with profile id in range from 8 - 47 + endcomment + assign password = "password" + assign last_name = "User" + + for i in (1..40) + assign first_name = "Dummy" | append: i + assign name = first_name | append: " " | append: last_name + assign email = "dummy" | append: i | append: "@example.com" + + assign object = null + assign object = object | hash_merge: email: email + assign object = object | hash_merge: password: password + assign object = object | hash_merge: first_name: first_name + assign object = object | hash_merge: last_name: last_name + assign object = object | hash_merge: name: name + + function user = 'modules/core/commands/execute', mutation_name: 'modules/user/user/create', object: object, selection: 'user' + hash_assign object['user_id'] = user.id + + function profile = 'modules/user/commands/profiles/create', object: object + + assign event_payload = null | hash_merge: user_id: user.id + function _ = 'modules/core/commands/events/publish', type: 'user_created', object: event_payload, delay: null, max_attempts: null + endfor +%} +{% log r, type: 'migrations/create_users' %} \ No newline at end of file diff --git a/tests/post_import/app/migrations/20250805174905_create_dummy_conversations.liquid b/tests/post_import/app/migrations/20250805174905_create_dummy_conversations.liquid new file mode 100644 index 0000000..2ef5e2f --- /dev/null +++ b/tests/post_import/app/migrations/20250805174905_create_dummy_conversations.liquid @@ -0,0 +1,40 @@ +{% liquid + comment + creates chat rooms between users + endcomment + + assign seeded_participant_email = "test6@example.com" + graphql g = 'modules/user/profiles/search', email: seeded_participant_email + assign seeded_participant_id = g.records.results.first.id + assign dummyUsersAmount = 40 + + for i in (1..dummyUsersAmount) + assign migrated_participant_email = "" | append: "dummy" | append: i | append: '@example.com' + graphql g = 'modules/user/profiles/search', email: migrated_participant_email + assign migrated_participant_id = g.records.results.first.id + + assign participant_ids = "" | append: seeded_participant_id | append: "," | append: migrated_participant_id | split: "," + assign participant_read_ids = "" | append: seeded_participant_id + + assign object = null + assign object = object | hash_merge: participant_ids: participant_ids + assign object = object | hash_merge: participant_read_ids: participant_read_ids + function conversation = 'modules/core/commands/execute', mutation_name: 'modules/chat/conversations/create' object: object, selection: 'record_create' + + comment + create messages between users + endcomment + assign messageText = "" | append: "This is migrated message from " | append: seeded_participant_email | append: " to " | append: migrated_participant_email + + assign object = null + assign object = object | hash_merge: autor_id: seeded_participant_id + assign object = object | hash_merge: conversation_id: conversation.id + assign object = object | hash_merge: message: messageText + + function message = 'modules/core/commands/execute', mutation_name: 'modules/chat/messages/create' object: object, selection: 'record_create' + + assign event_object = null | hash_merge: message_id: object.id, app_host: context.location.host + function _ = 'modules/core/commands/events/publish', type: 'chat_message_created', object: event_object, delay: null, max_attempts: null + endfor +%} +{% log r, type: 'migrations/create_chat_rooms' %} \ No newline at end of file