Skip to content

Commit 469c89f

Browse files
committed
chore: JS specs
1 parent 184e742 commit 469c89f

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

app/frontend/editor/services/section.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { isBlank, uuid8, camelize } from '@/misc/utils'
22
import { normalize as coreNormalize } from 'normalizr'
3-
import { findSectionDefinition } from './theme'
43
import { SECTION_SCHEMA } from './page'
54

65
const NUMBER_OF_DEFAULT_BLOCKS = 3

app/frontend/editor/services/theme.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,4 @@ export const buildCategories = (theme) => {
55
.filter((section) => section.category == category.id)
66
.sort((a, b) => a.name.localeCompare(b.name)),
77
}))
8-
}
9-
10-
export const findSectionDefinition = (theme, sectionContent) => {
11-
return theme.sections.find(
12-
(definition) => definition['id'] === sectionContent['type'],
13-
)
148
}

app/frontend/editor/spec/__mocks__/services.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const siteService = {
1414
}
1515

1616
const themeService = {
17-
buildCategories: vi.fn(),
17+
buildCategories: vi.fn()
1818
}
1919

2020
const pageService = {

app/frontend/editor/store/getters.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ export default (services) => ({
5858
sectionDefinition:
5959
({ theme }) =>
6060
(sectionContent) => {
61-
return services.theme.findSectionDefinition(theme, sectionContent)
61+
return theme.sections.find(
62+
(definition) => definition['id'] === sectionContent['type']
63+
)
6264
},
6365
sectionSettings:
6466
({ sectionDefinition }) =>

0 commit comments

Comments
 (0)