Add data-encoding to editor element

Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
Antonio Scandurra
2017-04-13 18:22:23 +02:00
parent 2a1ba7f05b
commit 26b9273e00
2 changed files with 10 additions and 1 deletions

View File

@@ -421,6 +421,15 @@ describe('TextEditorComponent', () => {
await component.getNextUpdatePromise()
expect(element.dataset.grammar).toBe('source js')
})
it('adds the data-encoding attribute and updates it when the encoding changes', async () => {
const {editor, element, component} = buildComponent()
expect(element.dataset.encoding).toBe('utf8')
editor.setEncoding('ascii')
await component.getNextUpdatePromise()
expect(element.dataset.encoding).toBe('ascii')
})
})
describe('mini editors', () => {