Skip to content
Open
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
17 changes: 17 additions & 0 deletions packages/realm-server/tests/card-source-endpoints-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,14 @@ module(basename(import.meta.filename), function () {

module('card source GET request', function (_hooks) {
module('public readable realm', function (hooks) {
// Read-only module: every test either reads fixture files that no
// test mutates or writes to a path unique to that test, so the boot
// is safe to share across tests. `mode: 'before'` boots the realm
// once for the module instead of once per test.
setupPermissionedRealmCached(hooks, {
fixture: 'realistic',
realmURL,
mode: 'before',
permissions: {
'*': ['read'],
'@node-test_realm:localhost': ['read', 'realm-owner'],
Expand Down Expand Up @@ -498,9 +503,12 @@ module(basename(import.meta.filename), function () {
});

module('permissioned realm', function (hooks) {
// Read-only module (auth checks on GET /person.gts): shared boot is
// safe since no test mutates realm state.
setupPermissionedRealmCached(hooks, {
fixture: 'simple',
realmURL,
mode: 'before',
permissions: {
john: ['read'],
'@node-test_realm:localhost': ['read', 'realm-owner'],
Expand Down Expand Up @@ -550,9 +558,12 @@ module(basename(import.meta.filename), function () {

module('card source HEAD request', function (_hooks) {
module('public readable realm', function (hooks) {
// Read-only module: HEAD requests plus one write to a unique path
// (notes.md), so the boot is safe to share across tests.
setupPermissionedRealmCached(hooks, {
fixture: 'simple',
realmURL,
mode: 'before',
permissions: {
'*': ['read'],
'@node-test_realm:localhost': ['read', 'realm-owner'],
Expand Down Expand Up @@ -1149,6 +1160,10 @@ module(basename(import.meta.filename), function () {
});

module('public writable realm with size limit', function (hooks) {
// Carry the same file/audio/video limits as the binary size-limit
// module below so both share one cached template (the template cache
// key includes the limits). The audio/video limits are inert for this
// module's single .gts test but let it dedupe the template build.
setupPermissionedRealmCached(hooks, {
fixture: 'simple',
realmURL,
Expand All @@ -1157,6 +1172,8 @@ module(basename(import.meta.filename), function () {
'@node-test_realm:localhost': ['read', 'realm-owner'],
},
fileSizeLimitBytes: 512,
audioSizeLimitBytes: 2048,
videoSizeLimitBytes: 8192,
onRealmSetup,
});

Expand Down
Loading