Skip to content

Commit

Permalink
fix lin
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonrobledo committed Jul 16, 2024
1 parent a794731 commit 9390742
Showing 1 changed file with 58 additions and 58 deletions.
116 changes: 58 additions & 58 deletions packages/mdctl-core/test/section.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-underscore-dangle */
const assert = require('assert'),
{ ExportSection } = require('../streams/section')
{ ExportSection } = require('../streams/section')

Check warning on line 3 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 6 spaces but found 2

Check warning on line 3 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected indentation of 6 spaces but found 2

Check warning on line 3 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected indentation of 6 spaces but found 2

describe('ExportSection', () => {
let exportSection
Expand All @@ -20,9 +20,9 @@ describe('ExportSection', () => {

it('should add itself to sectionsWithResources if it has resourceIds and sectionsWithResources is an array', () => {
const sectionsWithResources = [],
content = {
resourceId: 'resource1'
}
content = {

Check warning on line 23 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 12 spaces but found 8

Check warning on line 23 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected indentation of 12 spaces but found 8

Check warning on line 23 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected indentation of 12 spaces but found 8
resourceId: 'resource1'

Check warning on line 24 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 14 spaces but found 10

Check warning on line 24 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected indentation of 14 spaces but found 10

Check warning on line 24 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected indentation of 14 spaces but found 10
}

Check warning on line 25 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 12 spaces but found 8

Check warning on line 25 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected indentation of 12 spaces but found 8

Check warning on line 25 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected indentation of 12 spaces but found 8
exportSection = new ExportSection(content, 'key', sectionsWithResources)

assert.strictEqual(sectionsWithResources.length, 1)
Expand All @@ -31,17 +31,17 @@ describe('ExportSection', () => {

it('should not add itself to sectionsWithResources if it does not have resourceIds', () => {
const sectionsWithResources = [],
content = {}
content = {}

Check warning on line 34 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 12 spaces but found 8

Check warning on line 34 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected indentation of 12 spaces but found 8

Check warning on line 34 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected indentation of 12 spaces but found 8
exportSection = new ExportSection(content, 'key', sectionsWithResources)

assert.strictEqual(sectionsWithResources.length, 0)
})

it('should not add itself to sectionsWithResources if sectionsWithResources is not an array', () => {
const sectionsWithResources = {},
content = {
resourceId: 'resource1'
}
content = {

Check warning on line 42 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 12 spaces but found 8

Check warning on line 42 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected indentation of 12 spaces but found 8

Check warning on line 42 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected indentation of 12 spaces but found 8
resourceId: 'resource1'

Check warning on line 43 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 14 spaces but found 10

Check warning on line 43 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected indentation of 14 spaces but found 10

Check warning on line 43 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected indentation of 14 spaces but found 10
}

Check warning on line 44 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 12 spaces but found 8

Check warning on line 44 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected indentation of 12 spaces but found 8

Check warning on line 44 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected indentation of 12 spaces but found 8
exportSection = new ExportSection(content, 'key', sectionsWithResources)

assert.strictEqual(sectionsWithResources.length, undefined)
Expand All @@ -51,45 +51,45 @@ describe('ExportSection', () => {
describe('extractAssets', () => {
it('should add extraFiles to the exportSection if resource is found in sectionsWithResources #CTXAPI-2569', () => {
const chunks = [
{
name: 'Section 1 with resources',
object: 'env',
resource: 'env',
favicon: [
{
filename: 'favicon.ico',
name: 'content',
mime: 'image/x-icon',
object: 'facet',
resourceId: 'e6bd7abd-d7b8-42af-a5d8-52666fc44943'
}
],
},
{
name: 'Section 2 with resources',
logo: [
{
filename: 'medable_logo_sm.png',
name: 'content',
mime: 'image/png',
object: 'facet',
resourceId: '1d1de797-6a1e-4d7e-a3c8-b76f4a4b4df1'
},
{
filename: 'medable_logo_sm.png',
name: 'thumbnail',
mime: 'image/png',
object: 'facet',
resourceId: 'adfa4f86-f6e5-4f6c-b52f-98a55ba4815f'
}
],
object: 'env',
resource: 'env',
},
],

sectionsWithResources = [],
sections = []
{

Check warning on line 54 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 14 spaces but found 8

Check warning on line 54 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected indentation of 14 spaces but found 8

Check warning on line 54 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected indentation of 14 spaces but found 8
name: 'Section 1 with resources',

Check warning on line 55 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected indentation of 16 spaces but found 10

Check warning on line 55 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected indentation of 16 spaces but found 10

Check warning on line 55 in packages/mdctl-core/test/section.test.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected indentation of 16 spaces but found 10
object: 'env',
resource: 'env',
favicon: [
{
filename: 'favicon.ico',
name: 'content',
mime: 'image/x-icon',
object: 'facet',
resourceId: 'e6bd7abd-d7b8-42af-a5d8-52666fc44943'
}
],
},
{
name: 'Section 2 with resources',
logo: [
{
filename: 'medable_logo_sm.png',
name: 'content',
mime: 'image/png',
object: 'facet',
resourceId: '1d1de797-6a1e-4d7e-a3c8-b76f4a4b4df1'
},
{
filename: 'medable_logo_sm.png',
name: 'thumbnail',
mime: 'image/png',
object: 'facet',
resourceId: 'adfa4f86-f6e5-4f6c-b52f-98a55ba4815f'
}
],
object: 'env',
resource: 'env',
},
],

sectionsWithResources = [],
sections = []

chunks.forEach((chunk) => {
// eslint-disable-next-line no-new
Expand Down Expand Up @@ -132,19 +132,19 @@ describe('ExportSection', () => {

describe('extractScripts', () => {
it('should not process scripts if the object is i18n', () => {
const section = new ExportSection({
object: 'i18n',
resourceId: 'resource1',
data: {
script: {
invalidArgument: {
message: 'Invalid script.'
}
const section = new ExportSection({
object: 'i18n',
resourceId: 'resource1',
data: {
script: {
invalidArgument: {
message: 'Invalid script.'
}
}
}, 'i18n', [])
section.extractScripts()
assert.strictEqual(section.scriptFiles.length, 0)
}
}, 'i18n', [])
section.extractScripts()
assert.strictEqual(section.scriptFiles.length, 0)
})
})
})

0 comments on commit 9390742

Please sign in to comment.