Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/views/pages/index.liquid
Original file line number Diff line number Diff line change
@@ -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
%}
%}
5 changes: 4 additions & 1 deletion tests/data/seed/seed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 -
17 changes: 17 additions & 0 deletions tests/messaging.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
});
Original file line number Diff line number Diff line change
@@ -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' %}
Original file line number Diff line number Diff line change
@@ -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' %}
Loading