Skip to content

Commit

Permalink
Slightly improve confusing variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
start committed Sep 24, 2020
1 parent 8313014 commit d8b6925
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 85 deletions.
14 changes: 7 additions & 7 deletions src/Test/FiddlingWithSyntaxTree/Document.create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ import { expect } from 'chai'
import * as Up from '../../Main'


const NOT_USED: string = null!
const IGNORED_FIELD: string = null!

context('The `Document.create` method is automatically used during the normal parsing process. It returns a document object with:', () => {
specify('A table of contents', () => {
const documentChildren = [
new Up.Heading([new Up.Text('I enjoy apples')], { level: 1, titleMarkup: NOT_USED }),
new Up.Heading([new Up.Text('I enjoy apples')], { level: 1, titleMarkup: IGNORED_FIELD }),
new Up.NumberedList([
new Up.NumberedList.Item([
new Up.Heading([new Up.Text("They're cheap")], { level: 2, titleMarkup: NOT_USED }),
new Up.Heading([new Up.Text("They're cheap")], { level: 2, titleMarkup: IGNORED_FIELD }),
new Up.Paragraph([new Up.Text('Very cheap.')])
]),
new Up.NumberedList.Item([
new Up.Heading([new Up.Text("They're delicious")], { level: 2, titleMarkup: NOT_USED }),
new Up.Heading([new Up.Text("They're delicious")], { level: 2, titleMarkup: IGNORED_FIELD }),
new Up.Paragraph([new Up.Text('Very delicious.')])
])
])
Expand All @@ -26,21 +26,21 @@ context('The `Document.create` method is automatically used during the normal pa
const enjoyHeading =
new Up.Heading([new Up.Text('I enjoy apples')], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

const cheapHeading =
new Up.Heading([new Up.Text("They're cheap")], {
level: 2,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 2
})

const deliciousHeading =
new Up.Heading([new Up.Text("They're delicious")], {
level: 2,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 3
})

Expand Down
4 changes: 2 additions & 2 deletions src/Test/Html/Escaping/AttributeValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ context('Within any attribute value, all instances of " and & are escaped. Speci
}
})

const NOT_USED: string = null!
const IGNORED_FIELD: string = null!

const heading =
new Up.Heading([new Up.Text('I enjoy apples')], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down
6 changes: 3 additions & 3 deletions src/Test/Html/Escaping/Content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,15 @@ describe("Within an audio convention's fallback link content, all instances of <


context('Within a table of contents entry, all instances of < and & are escaped:', () => {
const NOT_USED: string = null!
const IGNORED_FIELD: string = null!

specify('In the table of contents itself', () => {
const heading =
new Up.Heading([
new Up.Text('4 & 5 < 10, and 6 & 7 < 10. Coincidence?')
], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand All @@ -323,7 +323,7 @@ context('Within a table of contents entry, all instances of < and & are escaped:
new Up.Text('4 & 5 < 10, and 6 & 7 < 10. Coincidence?')
], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down
6 changes: 3 additions & 3 deletions src/Test/Html/IdWordDelimiting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai'
import * as Up from '../../Main'


const NOT_USED: string = null!
const IGNORED_FIELD: string = null!

context('Words within HTML IDs are delimited by hyphens.', () => {
context('This applies to terms appearing in IDs:', () => {
Expand Down Expand Up @@ -62,7 +62,7 @@ context('Words within HTML IDs are delimited by hyphens.', () => {
const heading =
new Up.Heading([new Up.Text('I enjoy apples')], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down Expand Up @@ -152,7 +152,7 @@ context('Words within HTML IDs are delimited by hyphens.', () => {
const heading =
new Up.Heading([new Up.Text('I enjoy apples')], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down
10 changes: 5 additions & 5 deletions src/Test/Html/Links/NestedLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai'
import * as Up from '../../../Main'


const NOT_USED: string = null!
const IGNORED_FIELD: string = null!

context('Inside a link', () => {
specify("a footnote does not produce another <a> element. The footnote's <sup> directly contains the footnote's reference number", () => {
Expand Down Expand Up @@ -41,7 +41,7 @@ context('A link within a table of contents entry does not produce an <a> element
new Up.Link([new Up.Text('I enjoy apples')], 'https://google.com')
], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand All @@ -64,7 +64,7 @@ context('A link within a table of contents entry does not produce an <a> element
new Up.Link([new Up.Text('I enjoy apples')], 'https://google.com')
], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down Expand Up @@ -134,7 +134,7 @@ context("When a link is nested deeply within another link, it doesn't produce an
], 'https://apple.com')
], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand All @@ -161,7 +161,7 @@ context("When a link is nested deeply within another link, it doesn't produce an
], 'https://apple.com')
], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down
4 changes: 2 additions & 2 deletions src/Test/Html/Settings/Changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ describe('The "footnote" term', () => {


describe('The "sectionReferencedByTableOfContents" setting', () => {
const NOT_USED: string = null!
const IGNORED_FIELD: string = null!

const heading = new Up.Heading([], { level: 1, titleMarkup: NOT_USED })
const heading = new Up.Heading([], { level: 1, titleMarkup: IGNORED_FIELD })

itCanBeProvidedMultipleWaysWithTheSameResult({
document: new Up.Document(
Expand Down
22 changes: 11 additions & 11 deletions src/Test/Html/Settings/IdPrefix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,13 @@ describe('The IDs and names of elements rendered for revealable blocks', () => {
})


const NOT_USED: string = null!
const IGNORED_FIELD: string = null!

describe('The ID of an element referenced by the table of contents', () => {
it("is prefixed with the default ID prefix 'up' if one wasn't provided", () => {
const heading = new Up.Heading([], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand All @@ -382,7 +382,7 @@ describe('The ID of an element referenced by the table of contents', () => {

const heading = new Up.Heading([], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand All @@ -406,7 +406,7 @@ describe('The ID of an element referenced by the table of contents', () => {

const heading = new Up.Heading([], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand All @@ -430,7 +430,7 @@ describe('The ID of an element referenced by the table of contents', () => {

const heading = new Up.Heading([], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand All @@ -454,7 +454,7 @@ describe('The ID of an element referenced by the table of contents', () => {

const heading = new Up.Heading([], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand All @@ -479,7 +479,7 @@ describe('The URL of a section link (which is the ID of the actual entry in the
new Up.Text('Howdy there')
], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down Expand Up @@ -509,7 +509,7 @@ describe('The URL of a section link (which is the ID of the actual entry in the
new Up.Text('Howdy there')
], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down Expand Up @@ -539,7 +539,7 @@ describe('The URL of a section link (which is the ID of the actual entry in the
new Up.Text('Howdy there')
], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down Expand Up @@ -569,7 +569,7 @@ describe('The URL of a section link (which is the ID of the actual entry in the
new Up.Text('Howdy there')
], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down Expand Up @@ -599,7 +599,7 @@ describe('The URL of a section link (which is the ID of the actual entry in the
new Up.Text('Howdy there')
], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down
4 changes: 2 additions & 2 deletions src/Test/Html/Settings/SectionReferencedByTableOfContents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ describe('The ID of an element referenced by the table of contents', () => {
}
})

const NOT_USED: string = null!
const IGNORED_FIELD: string = null!

const heading =
new Up.Heading([new Up.Text('I enjoy apples')], {
level: 1,
titleMarkup: NOT_USED,
titleMarkup: IGNORED_FIELD,
ordinalInTableOfContents: 1
})

Expand Down
24 changes: 12 additions & 12 deletions src/Test/Html/SingleNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai'
import * as Up from '../../Main'


const NOT_USED: string = null!
const IGNORED_FIELD: string = null!

describe('An empty document', () => {
it('does not produce any HTML on its own', () => {
Expand Down Expand Up @@ -512,7 +512,7 @@ describe('A blockquote node', () => {
describe('A level 1 heading node', () => {
it('renders an <h1> element', () => {
const document = new Up.Document([
new Up.Heading([new Up.Text('Bulbasaur')], { level: 1, titleMarkup: NOT_USED })
new Up.Heading([new Up.Text('Bulbasaur')], { level: 1, titleMarkup: IGNORED_FIELD })
])

expect(Up.render(document)).to.equal('<h1>Bulbasaur</h1>')
Expand All @@ -523,7 +523,7 @@ describe('A level 1 heading node', () => {
describe('A level 2 heading node', () => {
it('renders an <h2> element', () => {
const document = new Up.Document([
new Up.Heading([new Up.Text('Ivysaur')], { level: 2, titleMarkup: NOT_USED })
new Up.Heading([new Up.Text('Ivysaur')], { level: 2, titleMarkup: IGNORED_FIELD })
])

expect(Up.render(document)).to.equal('<h2>Ivysaur</h2>')
Expand All @@ -534,7 +534,7 @@ describe('A level 2 heading node', () => {
describe('A level 3 heading node', () => {
it('renders an <h3> element', () => {
const document = new Up.Document([
new Up.Heading([new Up.Text('Venusaur')], { level: 3, titleMarkup: NOT_USED })
new Up.Heading([new Up.Text('Venusaur')], { level: 3, titleMarkup: IGNORED_FIELD })
])

expect(Up.render(document)).to.equal('<h3>Venusaur</h3>')
Expand All @@ -545,7 +545,7 @@ describe('A level 3 heading node', () => {
describe('A level 4 heading node', () => {
it('renders an <h4> element', () => {
const document = new Up.Document([
new Up.Heading([new Up.Text('Charmander')], { level: 4, titleMarkup: NOT_USED })
new Up.Heading([new Up.Text('Charmander')], { level: 4, titleMarkup: IGNORED_FIELD })
])

expect(Up.render(document)).to.equal('<h4>Charmander</h4>')
Expand All @@ -556,7 +556,7 @@ describe('A level 4 heading node', () => {
describe('A level 5 heading node', () => {
it('renders an <h5> element', () => {
const document = new Up.Document([
new Up.Heading([new Up.Text('Charmeleon')], { level: 5, titleMarkup: NOT_USED })
new Up.Heading([new Up.Text('Charmeleon')], { level: 5, titleMarkup: IGNORED_FIELD })
])

expect(Up.render(document)).to.equal('<h5>Charmeleon</h5>')
Expand All @@ -567,7 +567,7 @@ describe('A level 5 heading node', () => {
describe('A level 6 heading node', () => {
it('renders an <h6> element', () => {
const document = new Up.Document([
new Up.Heading([new Up.Text('Charizard')], { level: 6, titleMarkup: NOT_USED })
new Up.Heading([new Up.Text('Charizard')], { level: 6, titleMarkup: IGNORED_FIELD })
])

expect(Up.render(document)).to.equal('<h6>Charizard</h6>')
Expand All @@ -578,31 +578,31 @@ describe('A level 6 heading node', () => {
context('Headings with levels 7 and up render as <div role="heading"> elements with an "aria-level" attribute equal to their level:', () => {
specify('Level 7', () => {
const document = new Up.Document([
new Up.Heading([new Up.Text('Squirtle')], { level: 7, titleMarkup: NOT_USED })
new Up.Heading([new Up.Text('Squirtle')], { level: 7, titleMarkup: IGNORED_FIELD })
])

expect(Up.render(document)).to.equal('<div aria-level="7" role="heading">Squirtle</div>')
})

specify('Level 8', () => {
const document = new Up.Document([
new Up.Heading([new Up.Text('Squirtle')], { level: 8, titleMarkup: NOT_USED })
new Up.Heading([new Up.Text('Squirtle')], { level: 8, titleMarkup: IGNORED_FIELD })
])

expect(Up.render(document)).to.equal('<div aria-level="8" role="heading">Squirtle</div>')
})

specify('Level 9', () => {
const document = new Up.Document([
new Up.Heading([new Up.Text('Squirtle')], { level: 9, titleMarkup: NOT_USED })
new Up.Heading([new Up.Text('Squirtle')], { level: 9, titleMarkup: IGNORED_FIELD })
])

expect(Up.render(document)).to.equal('<div aria-level="9" role="heading">Squirtle</div>')
})

specify('Level 10', () => {
const document = new Up.Document([
new Up.Heading([new Up.Text('Squirtle')], { level: 10, titleMarkup: NOT_USED })
new Up.Heading([new Up.Text('Squirtle')], { level: 10, titleMarkup: IGNORED_FIELD })
])

expect(Up.render(document)).to.equal('<div aria-level="10" role="heading">Squirtle</div>')
Expand Down Expand Up @@ -755,7 +755,7 @@ describe('A section link node that is associated with a table of contents entry'
it('renders a link to the entry in the document', () => {
const heading = new Up.Heading([
new Up.Text('Howdy there')
], { level: 1, titleMarkup: NOT_USED, ordinalInTableOfContents: 1 })
], { level: 1, titleMarkup: IGNORED_FIELD, ordinalInTableOfContents: 1 })

const document =
new Up.Document([
Expand Down
Loading

0 comments on commit d8b6925

Please sign in to comment.