mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 00:11:10 +00:00
Removes the option to disable theme scripts
This commit is contained in:
1 parent
531450b3db
commit
15945c2e56
17 files changed
+15
-201
No files matched your search
-3
@@ -20,17 +20,14 @@ public class ThemeSettingsResponseFixture
|
||||
/// Creates a random valid <see cref="ThemeSettingsResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="maxArchiveBytes">Optional. The maximum allowed size of a theme archive, in bytes.</param>
|
||||
/// <param name="allowThemeScripts">Optional. Whether theme templates may contain script elements.</param>
|
||||
/// <param name="defaultThemeId">Optional. The identifier of the default theme.</param>
|
||||
/// <returns>The created <see cref="ThemeSettingsResponse"/>.</returns>
|
||||
public ThemeSettingsResponse Create(
|
||||
long? maxArchiveBytes = null,
|
||||
bool? allowThemeScripts = null,
|
||||
string? defaultThemeId = null)
|
||||
{
|
||||
return new ThemeSettingsResponse(
|
||||
maxArchiveBytes ?? _faker.Random.Long(1_000_000, 100_000_000),
|
||||
allowThemeScripts ?? _faker.Random.Bool(),
|
||||
defaultThemeId ?? _faker.Lorem.Slug(2));
|
||||
}
|
||||
|
||||
|
||||
+2
-5
@@ -25,7 +25,6 @@ public class ThemeEngineOptionsDtoFixture
|
||||
/// <param name="maxExpandedBytes">Optional maximum total size of an extracted theme pack, in bytes.</param>
|
||||
/// <param name="maxSingleFileBytes">Optional maximum size of a single file within a theme pack, in bytes.</param>
|
||||
/// <param name="maxEntries">Optional maximum number of entries in a theme pack archive.</param>
|
||||
/// <param name="allowThemeScripts">Optional value indicating whether script elements are allowed.</param>
|
||||
/// <returns>A configured <see cref="ThemeEngineOptionsDto"/> instance.</returns>
|
||||
public ThemeEngineOptionsDto Create(
|
||||
string? storagePath = null,
|
||||
@@ -34,8 +33,7 @@ public class ThemeEngineOptionsDtoFixture
|
||||
long? maxArchiveBytes = null,
|
||||
long? maxExpandedBytes = null,
|
||||
long? maxSingleFileBytes = null,
|
||||
int? maxEntries = null,
|
||||
bool? allowThemeScripts = null)
|
||||
int? maxEntries = null)
|
||||
{
|
||||
Faker faker = new();
|
||||
return new ThemeEngineOptionsDto
|
||||
@@ -46,8 +44,7 @@ public class ThemeEngineOptionsDtoFixture
|
||||
MaxArchiveBytes = maxArchiveBytes ?? faker.Random.Long(1_000_000, 100_000_000),
|
||||
MaxExpandedBytes = maxExpandedBytes ?? faker.Random.Long(10_000_000, 500_000_000),
|
||||
MaxSingleFileBytes = maxSingleFileBytes ?? faker.Random.Long(1_000_000, 50_000_000),
|
||||
MaxEntries = maxEntries ?? faker.Random.Int(1, 1000),
|
||||
AllowThemeScripts = allowThemeScripts ?? faker.Random.Bool()
|
||||
MaxEntries = maxEntries ?? faker.Random.Int(1, 1000)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
-3
@@ -18,18 +18,15 @@ public class ThemeSettingsResponseDtoFixture
|
||||
/// Creates a new <see cref="ThemeSettingsResponseDto"/> instance with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="maxArchiveBytes">Optional maximum allowed archive size, in bytes.</param>
|
||||
/// <param name="allowThemeScripts">Whether theme templates may load script files.</param>
|
||||
/// <param name="defaultThemeId">Optional identifier of the fallback theme.</param>
|
||||
/// <returns>A configured <see cref="ThemeSettingsResponseDto"/> instance.</returns>
|
||||
public ThemeSettingsResponseDto Create(
|
||||
long? maxArchiveBytes = null,
|
||||
bool? allowThemeScripts = null,
|
||||
string? defaultThemeId = null)
|
||||
{
|
||||
Faker faker = new();
|
||||
return new ThemeSettingsResponseDto(
|
||||
MaxArchiveBytes: maxArchiveBytes ?? faker.Random.Long(1024 * 1024, 256 * 1024 * 1024),
|
||||
AllowThemeScripts: allowThemeScripts ?? faker.Random.Bool(),
|
||||
DefaultThemeId: defaultThemeId ?? faker.Lorem.Word()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user