Skip to content

Commit

Permalink
🚨 #133 apply linter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JAGFx committed Aug 29, 2022
1 parent 8a67dcc commit 4016ad2
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 72 deletions.
2 changes: 1 addition & 1 deletion src/jagfx/application/style/abstracts/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
linear-gradient(#fff 0 0) content-box,
linear-gradient(#fff 0 0);

//mask-composite: xor;
// mask-composite: xor;
mask-composite: exclude;
padding: $width;
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion src/jagfx/application/style/vendors/_bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

.text-gradient {
background-clip: text;
-webkit-background-clip: text;
-webkit-background-clip: text; /* stylelint-disable-line */
background-image: $gradient-accent;
-webkit-text-fill-color: transparent;
}
Expand Down
62 changes: 31 additions & 31 deletions src/jagfx/core/configuration/preference-entry/filter.spec.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
import { PreferenceEntry } from "@/jagfx/core/configuration/preference-entry/PreferenceEntry";
import { applyFiltersToPreferenceEntriesList } from "@/jagfx/core/configuration/preference-entry/filter";
import { PreferenceEntry } from '@/jagfx/core/configuration/preference-entry/PreferenceEntry';
import { applyFiltersToPreferenceEntriesList } from '@/jagfx/core/configuration/preference-entry/filter';

const existingConfiguration = [
{
id: "an_existing_configuration_id",
target: "application",
label: "Configuration 1",
description: "Description 1",
id: 'an_existing_configuration_id',
target: 'application',
label: 'Configuration 1',
description: 'Description 1',
values: [
{
label: "Value 1",
value: "value1",
},
],
label: 'Value 1',
value: 'value1'
}
]
},
{
id: "another_existing_configuration_id",
target: "application",
label: "Unicorn label 2",
description: "Description 2",
values: null,
},
id: 'another_existing_configuration_id',
target: 'application',
label: 'Unicorn label 2',
description: 'Description 2',
values: null
}
];

describe("Preference entry filter", () => {
describe('Preference entry filter', () => {
const unknownFilters = [
[],
{},
"",
"string",
'',
'string',
123,
undefined,
null,
new PreferenceEntry(),
{ label: "" },
{ target: "" },
{ label: "", target: "" },
{ label: '' },
{ target: '' },
{ label: '', target: '' }
];

it.each(unknownFilters)(
"Preference entries must not have any differences with invalid filters",
'Preference entries must not have any differences with invalid filters',
(filter) => {
expect(
applyFiltersToPreferenceEntriesList(filter, existingConfiguration)
Expand All @@ -48,16 +48,16 @@ describe("Preference entry filter", () => {
);

const validFilters = [
{ label: "Unicorn label 2" },
{ label: "unicorn label 2" },
{ label: "LaBeL" },
{ label: "uni" },
{ label: "2" },
{ label: "uni", target: "app" },
{ label: "uni", target: "application" },
{ label: 'Unicorn label 2' },
{ label: 'unicorn label 2' },
{ label: 'LaBeL' },
{ label: 'uni' },
{ label: '2' },
{ label: 'uni', target: 'app' },
{ label: 'uni', target: 'application' }
];
it.each(validFilters)(
"A preference entry must be returned with matched filters",
'A preference entry must be returned with matched filters',
(filter) => {
expect(
applyFiltersToPreferenceEntriesList(filter, existingConfiguration).at(0)
Expand Down
4 changes: 2 additions & 2 deletions src/jagfx/core/configuration/preference-entry/finder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PreferenceEntry } from "@/jagfx/core/configuration/preference-entry/PreferenceEntry.js";
import map from "@/jagfx/core/configuration/preference-entry/map.json";
import { PreferenceEntry } from '@/jagfx/core/configuration/preference-entry/PreferenceEntry.js';
import map from '@/jagfx/core/configuration/preference-entry/map.json';

export const findPreferenceEntryById = (preferenceEntryId) => {
const matches = map.filter(
Expand Down
48 changes: 24 additions & 24 deletions src/jagfx/core/configuration/preference-entry/finder.spec.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
import { PreferenceEntry } from "@/jagfx/core/configuration/preference-entry/PreferenceEntry";
import { PreferenceEntry } from '@/jagfx/core/configuration/preference-entry/PreferenceEntry';
import {
convertJsonObjectToPreferenceEntry,
findPreferenceEntryById,
} from "@/jagfx/core/configuration/preference-entry/finder";
findPreferenceEntryById
} from '@/jagfx/core/configuration/preference-entry/finder';

const existingConfigurationId = "an_existing_configuration_id";
const existingConfigurationId = 'an_existing_configuration_id';
const existingConfiguration = [
{
id: "an_existing_configuration_id",
target: "application",
label: "Configuration 1",
description: "Description 1",
id: 'an_existing_configuration_id',
target: 'application',
label: 'Configuration 1',
description: 'Description 1',
values: [
{
label: "Value 1",
value: "value1",
},
],
label: 'Value 1',
value: 'value1'
}
]
},
{
id: "another_existing_configuration_id",
target: "application",
label: "Unicorn label 2",
description: "Description 2",
values: null,
},
id: 'another_existing_configuration_id',
target: 'application',
label: 'Unicorn label 2',
description: 'Description 2',
values: null
}
];

jest.mock(
"@/jagfx/core/configuration/preference-entry/map.json",
'@/jagfx/core/configuration/preference-entry/map.json',
() => existingConfiguration
);

describe("Preference entries finder", () => {
it("An existing preference entry must return data successfully", () => {
describe('Preference entries finder', () => {
it('An existing preference entry must return data successfully', () => {
const configuration = findPreferenceEntryById(existingConfigurationId);

expect(configuration).toMatchObject(existingConfiguration.at(0));
});

it("An unknown preference entry must thrown an exception", () => {
const unknownPreferenceEntryId = "an_unknown_preference_entry_id";
it('An unknown preference entry must thrown an exception', () => {
const unknownPreferenceEntryId = 'an_unknown_preference_entry_id';
expect(() =>
findPreferenceEntryById(unknownPreferenceEntryId)
).toThrowError(
`Unable to find ${unknownPreferenceEntryId} on preference entries list`
);
});

it("An object typed of PreferenceEntry must be returned by the converter successfully", () => {
it('An object typed of PreferenceEntry must be returned by the converter successfully', () => {
const anonymousObject = existingConfiguration.at(0);
const convertedObject = convertJsonObjectToPreferenceEntry(anonymousObject);

Expand Down
4 changes: 2 additions & 2 deletions src/jagfx/core/configuration/preference-entry/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ export const loadPreferenceEntryValues = (preferenceEntry) => {
if (
Array.isArray(preferenceEntry) ||
preferenceEntry === null ||
typeof preferenceEntry !== "object" ||
typeof preferenceEntry !== 'object' ||
!Array.isArray(preferenceEntry.values) ||
!Object.hasOwnProperty.call(preferenceEntry, "values") ||
!Object.hasOwnProperty.call(preferenceEntry, 'values') ||
preferenceEntry.values === null
) {
return null;
Expand Down
22 changes: 11 additions & 11 deletions src/jagfx/core/configuration/preference-entry/loader.spec.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { loadPreferenceEntryValues } from "@/jagfx/core/configuration/preference-entry/loader";
import { loadPreferenceEntryValues } from '@/jagfx/core/configuration/preference-entry/loader';

const mockPreferenceEntry = (values) => ({
values,
values
});

describe("Preference entries finder", () => {
describe('Preference entries finder', () => {
// Array not empty > Return this array
// Array empty > Perform external request
// Null > No value, return null
it("Should return the same array if preference entry value is an array not empty", () => {
const preferenceEntry = mockPreferenceEntry(["some", "stuff"]);
it('Should return the same array if preference entry value is an array not empty', () => {
const preferenceEntry = mockPreferenceEntry(['some', 'stuff']);

expect(loadPreferenceEntryValues(preferenceEntry)).toBe(
preferenceEntry.values
Expand All @@ -18,17 +18,17 @@ describe("Preference entries finder", () => {

const invalidPreferenceEntries = [
{},
"",
"string",
'',
'string',
123,
undefined,
null,
new Event(""),
{ label: "" },
mockPreferenceEntry(null),
new Event(''),
{ label: '' },
mockPreferenceEntry(null)
];
it.each(invalidPreferenceEntries)(
"Should return null with invalid preferenceEntry",
'Should return null with invalid preferenceEntry',
(invalidPreferenceEntry) => {
expect(loadPreferenceEntryValues(invalidPreferenceEntry)).toBeNull();
}
Expand Down

0 comments on commit 4016ad2

Please sign in to comment.