Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#41156 closed enhancement (fixed)

Refactor Emoji browser support tests to prevent repetition.

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

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 9 years ago.

Download all attachments as: .zip

Change History (4)

@peterwilsoncc
9 years ago

#1 @peterwilsoncc
9 years ago

  • Keywords has-patch added

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

#2 @pento
9 years ago

  • Keywords commit added
  • Owner set to peterwilsoncc
  • Status newassigned

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

#3 @peterwilsoncc
9 years ago

  • Resolutionfixed
  • Status assignedclosed

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.