Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#41156 closed enhancement (fixed)

Refactor Emoji browser support tests to prevent repetition.

Reported by: peterwilsoncc's profile peterwilsoncc Owned by: peterwilsoncc's profile peterwilsoncc
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Emoji Keywords: has-patch commit
Focuses: javascript Cc:

Description

The tests for Emoji browser support writes to and clears the canvas several times.

The code to do this is repeated a number of times and should be refactored. The repitition lead to a couple of (unreleased) bugs recently.

Attachments (1)

41156.diff (4.9 KB) - added by peterwilsoncc 7 years ago.

Download all attachments as: .zip

Change History (4)

@peterwilsoncc
7 years ago

#1 @peterwilsoncc
7 years ago

  • Keywords has-patch added

In 41156.diff I've moved some repeated code into a new function.

#2 @pento
7 years ago

  • Keywords commit added
  • Owner set to peterwilsoncc
  • Status changed from new to assigned

And it reduces the minified code by 166 bytes, what's not to love?

#3 @peterwilsoncc
7 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 41669:

Emoji: Refactor browser support tests.

Moves the repeated code in the emoji browser support test to a function to reduced the potential for errors and follow DRY principles.

Renames the "emoji4" test "emoji" as unicode version specific tests were removed in [38869].

Props peterwilsoncc, pento for code review.
Fixes #41156.

Note: See TracTickets for help on using tickets.