suite('local-time', function() {
  test('null getFormattedDate when datetime missing', function() {
    var time = document.createElement('local-time')
    time.setAttribute('format', '%Y-%m-%dT%H:%M:%SZ')
    assert.isUndefined(time.getFormattedDate())
  })

  test('getFormattedDate returns empty string when format missing', function() {
    var time = document.createElement('local-time')
    time.setAttribute('datetime', '1970-01-01T00:00:00.000Z')
    assert.equal(time.getFormattedDate(), '')
  })

  test('getFormattedDate with only date attributes', function() {
    var time = document.createElement('local-time')
    time.setAttribute('datetime', '1970-01-01T00:00:00.000Z')
    time.setAttribute('day', 'numeric')
    time.setAttribute('month', 'short')
    time.setAttribute('year', 'numeric')

    var value = time.getFormattedDate()
    assert.include(['Dec 31, 1969', '31 Dec 1969', 'Jan 1, 1970', '1 Jan 1970'], value)
  })

  test('getFormattedDate without year attribute', function() {
    var time = document.createElement('local-time')
    time.setAttribute('datetime', '1970-01-01T00:00:00.000Z')
    time.setAttribute('day', 'numeric')
    time.setAttribute('month', 'short')

    var value = time.getFormattedDate()
    assert.include(['Dec 31', '31 Dec', 'Jan 1', '1 Jan'], value)
  })

  test('getFormattedDate with only time attributes', function() {
    var time = document.createElement('local-time')
    time.setAttribute('datetime', '1970-01-01T00:00:00.000Z')
    time.setAttribute('hour', 'numeric')
    time.setAttribute('minute', '2-digit')

    if ('Intl' in window) {
      assert.match(time.getFormattedDate(), /^\d{1,2}:\d\d (AM|PM)$/)
    } else {
      assert.match(time.getFormattedDate(), /^\d{2}:\d{2}$/)
    }
  })

  test('ignores contents if datetime attribute is missing', function() {
    var time = document.createElement('local-time')
    time.setAttribute('year', 'numeric')
    assert.equal(time.textContent, '')
  })

  test('sets formatted contents to format attribute', function() {
    var time = document.createElement('local-time')
    time.setAttribute('datetime', '1970-01-01T00:00:00.000Z')
    time.setAttribute('year', 'numeric')
    assert.include(['1969', '1970'], time.textContent)
  })

  test('sets formatted contents when parsed element is upgraded', function() {
    var root = document.createElement('div')
    root.innerHTML = '<local-time datetime="1970-01-01T00:00:00.000Z" year="numeric"></local-time>'
    if ('CustomElements' in window) {
      window.CustomElements.upgradeSubtree(root)
    }
    assert.include(['1969', '1970'], root.children[0].textContent)
  })

  ;('Intl' in window ? test : test.skip)('displays time zone name', function() {
    var time = document.createElement('local-time')
    time.setAttribute('datetime', '1970-01-01T00:00:00.000Z')
    time.setAttribute('minute', '2-digit')
    time.setAttribute('time-zone-name', 'short')
    assert.match(time.textContent, /^\d{1,2} (UTC|GMT([+-]\d+)?)$/)
  })
})

@@ -2638,17 +2638,16 @@
 t)%0A  %7D)%0A
-%0A
   ;('Int
@@ -2719,36 +2719,36 @@
 ion() %7B%0A    var 
-time
+root
  = document.crea
@@ -2762,52 +2762,62 @@
 nt('
-local-time')%0A    time.setAttribute('
+div')%0A    root.innerHTML =%0A      '%3Clocal-time 
 datetime
 ', '
@@ -2804,36 +2804,34 @@
 al-time datetime
-', '
+=%22
 1970-01-01T00:00
@@ -2842,124 +2842,191 @@
 000Z
-')%0A    time.setAttribute('minute', '2-digit')%0A    time.setAttribute('time-zone-name', 'short')%0A    assert.match(time
+%22 minute=%222-digit%22 time-zone-name=%22short%22%3E%3C/local-time%3E'%0A    if ('CustomElements' in window) %7B%0A      window.CustomElements.upgradeSubtree(root)%0A    %7D%0A    assert.match(root.children%5B0%5D
 .tex

Fix timezone test