Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
692c778
update image logic
AmarTrebinjac Oct 13, 2025
50895a6
add readme to return
AmarTrebinjac Oct 13, 2025
2005b42
update user stats
AmarTrebinjac Oct 13, 2025
f69d987
remove duplicate prop
AmarTrebinjac Oct 13, 2025
9803782
join column and idx
AmarTrebinjac Oct 14, 2025
05f1693
remove rep, rename type
AmarTrebinjac Oct 14, 2025
4115b53
increase image upload amount to 2
AmarTrebinjac Oct 15, 2025
253424f
fix merge issue
AmarTrebinjac Nov 5, 2025
5bb3245
remove readme from boot
AmarTrebinjac Nov 5, 2025
3994a64
re-add missing cover upload prop
AmarTrebinjac Nov 5, 2025
ff79aee
update schema
AmarTrebinjac Nov 5, 2025
161068d
Merge branch 'main' into MI-1067-update-user-profile
AmarTrebinjac Nov 6, 2025
62d7c94
Merge branch 'main' into MI-1067-update-user-profile
AmarTrebinjac Nov 7, 2025
797fe48
Merge branch 'main' into MI-1067-update-user-profile
AmarTrebinjac Nov 12, 2025
9ef02b5
add location to user
AmarTrebinjac Nov 12, 2025
a8e78c3
Merge branch 'main' into MI-1067-update-user-profile
AmarTrebinjac Nov 12, 2025
8ecc2b0
Merge branch 'main' into MI-1067-update-user-profile
AmarTrebinjac Nov 13, 2025
20a5661
Merge branch 'main' into MI-1067-update-user-profile
AmarTrebinjac Nov 13, 2025
67f0ee0
feat: new updateUserInfo endpoint
AmarTrebinjac Nov 14, 2025
e12a823
update tests
AmarTrebinjac Nov 14, 2025
a8ccdb9
revert user tests
AmarTrebinjac Nov 14, 2025
dee7483
add readme and language into boot
AmarTrebinjac Nov 14, 2025
9a2d9b6
Merge branch 'main' into update-user-info
AmarTrebinjac Nov 14, 2025
88f91e2
update boot test
AmarTrebinjac Nov 16, 2025
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
47 changes: 47 additions & 0 deletions __tests__/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
UserMarketingCta,
UserNotification,
} from '../src/entity';
import { DatasetLocation } from '../src/entity/dataset/DatasetLocation';
import {
OrganizationMemberRole,
SourceMemberRoles,
Expand Down Expand Up @@ -142,6 +143,7 @@ const LOGGED_IN_BODY = {
youtube: null,
linkedin: null,
mastodon: null,
readme: null,
language: undefined,
isPlus: false,
defaultFeedId: null,
Expand All @@ -155,6 +157,7 @@ const LOGGED_IN_BODY = {
coresRole: CoresRole.None,
clickbaitTries: null,
hasLocationSet: false,
location: null,
},
marketingCta: null,
feeds: [],
Expand Down Expand Up @@ -413,6 +416,48 @@ describe('logged in boot', () => {
expect(res.body.user.hasLocationSet).toBe(true);
});

it('should return location when user has locationId set', async () => {
const location = await con.getRepository(DatasetLocation).save({
country: 'United States',
city: 'San Francisco',
subdivision: 'California',
iso2: 'US',
iso3: 'USA',
timezone: 'America/Los_Angeles',
ranking: 1,
});

await con.getRepository(User).save({
...usersFixture[0],
locationId: location.id,
});

mockLoggedIn();
const res = await request(app.server)
.get(BASE_PATH)
.set('User-Agent', TEST_UA)
.set('Cookie', 'ory_kratos_session=value;')
.expect(200);

expect(res.body.user.location).toEqual({
id: location.id,
city: 'San Francisco',
subdivision: 'California',
country: 'United States',
});
});

it('should return null location when user has no locationId', async () => {
mockLoggedIn();
const res = await request(app.server)
.get(BASE_PATH)
.set('User-Agent', TEST_UA)
.set('Cookie', 'ory_kratos_session=value;')
.expect(200);

expect(res.body.user.location).toBeNull();
});

it('should set kratos cookie expiration', async () => {
mockLoggedIn();
const kratosCookie = 'ory_kratos_session';
Expand Down Expand Up @@ -1683,6 +1728,8 @@ describe('funnel boot', () => {
'subscriptionFlags',
'clickbaitTries',
'hasLocationSet',
'location',
'readme',
]),
});
});
Expand Down
Loading
Loading