-
-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rolled back escape calls for only tests that require them
- Loading branch information
1 parent
76b4ef5
commit 4ed5ea3
Showing
1 changed file
with
18 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,9 @@ describe('Notifier', () => { | |
|
||
const successMessages = notificationsElement.find('.success-indicator') | ||
|
||
// Notifications contain the "Saved" message and the new message | ||
// Notifications contain the hidden "Saved" message and the new message | ||
expect(successMessages.length).toBe(2) | ||
expect(successMessages[1].innerHTML).toContain(escape(notificationMessage)) | ||
expect(successMessages[1].innerHTML).toContain(notificationMessage) | ||
done() | ||
} catch (error) { | ||
done(error) | ||
|
@@ -54,7 +54,7 @@ describe('Notifier', () => { | |
const failureMessages = notificationsElement.find('.failure-indicator') | ||
|
||
expect(failureMessages.length).toBe(1) | ||
expect(failureMessages[0].innerHTML).toContain(escape(notificationMessage)) | ||
expect(failureMessages[0].innerHTML).toContain(notificationMessage) | ||
done() | ||
} catch (error) { | ||
done(error) | ||
|
@@ -328,10 +328,10 @@ describe('Notifications', () => { | |
test('removes the notification elements', (done) => { | ||
$(() => { | ||
try { | ||
expect(notificationsElement[0].innerHTML).toContain(escape(notificationDefaultMessage)) | ||
expect(notificationsElement[0].innerHTML).toContain(notificationDefaultMessage) | ||
|
||
notification.dismiss() | ||
expect(notificationsElement[0].innerHTML).not.toContain(escape(notificationDefaultMessage)) | ||
expect(notificationsElement[0].innerHTML).not.toContain(notificationDefaultMessage) | ||
done() | ||
} catch (error) { | ||
done(error) | ||
|
@@ -342,10 +342,10 @@ describe('Notifications', () => { | |
test('should throw an error if the notification has already been dismissed', (done) => { | ||
$(() => { | ||
try { | ||
expect(notificationsElement[0].innerHTML).toContain(escape(notificationDefaultMessage)) | ||
expect(notificationsElement[0].innerHTML).toContain(notificationDefaultMessage) | ||
|
||
notification.dismiss() | ||
expect(notificationsElement[0].innerHTML).not.toContain(escape(notificationDefaultMessage)) | ||
expect(notificationsElement[0].innerHTML).not.toContain(notificationDefaultMessage) | ||
|
||
expect(() => { | ||
notification.dismiss() | ||
|
@@ -362,8 +362,8 @@ describe('Notifications', () => { | |
test('should return the text of the notification', (done) => { | ||
$(() => { | ||
try { | ||
expect(notificationsElement[0].innerHTML).toContain(escape(notificationDefaultMessage)) | ||
expect(notification.getText()).toBe(escape(notificationDefaultMessage)) | ||
expect(notificationsElement[0].innerHTML).toContain(notificationDefaultMessage) | ||
expect(notification.getText()).toBe(notificationDefaultMessage) | ||
|
||
done() | ||
} catch (error) { | ||
|
@@ -377,7 +377,7 @@ describe('Notifications', () => { | |
test('returns a truthy value if there is a dismiss button, false otherwise', (done) => { | ||
$(() => { | ||
try { | ||
expect(notificationsElement[0].innerHTML).toContain(escape(notificationDefaultMessage)) | ||
expect(notificationsElement[0].innerHTML).toContain(notificationDefaultMessage) | ||
expect(notification.isUserDismissable()).toBeTruthy() | ||
|
||
notification.notificationElement.children('button').remove() | ||
|
@@ -428,7 +428,7 @@ describe('Notifications', () => { | |
const notificationMessage = 'mn6#:6C^*hnQ/:cC;2mM' | ||
notification = notifier.notify(notificationMessage, 'info', false) | ||
|
||
expect(notificationsElement[0].innerHTML).toContain(escape(notificationMessage)) | ||
expect(notificationsElement[0].innerHTML).toContain(notificationMessage) | ||
expect(notification.notificationElement.children('button').length).toBe(0) | ||
|
||
notification.setUserDismissable(true) | ||
|
@@ -448,7 +448,7 @@ describe('Notifications', () => { | |
test('does nothing if the notification is already in the desired state', (done) => { | ||
$(() => { | ||
try { | ||
expect(notificationsElement[0].innerHTML).toContain(escape(notificationDefaultMessage)) | ||
expect(notificationsElement[0].innerHTML).toContain(notificationDefaultMessage) | ||
expect(notification.notificationElement.children('button').length).toBe(1) | ||
|
||
notification.setUserDismissable(true) | ||
|
@@ -458,7 +458,7 @@ describe('Notifications', () => { | |
const notificationMessage = 'fd@4g*[email protected]{!^Yj*TR' | ||
notification = notifier.notify(notificationMessage, 'info', false) | ||
|
||
expect(notificationsElement[0].innerHTML).toContain(escape(notificationMessage)) | ||
expect(notificationsElement[0].innerHTML).toContain(notificationMessage) | ||
expect(notification.notificationElement.children('button').length).toBe(0) | ||
|
||
notification.setUserDismissable(false) | ||
|
@@ -474,7 +474,7 @@ describe('Notifications', () => { | |
test('removes the dismiss button that removes the notification element when clicked if the button is present', (done) => { | ||
$(() => { | ||
try { | ||
expect(notificationsElement[0].innerHTML).toContain(escape(notificationDefaultMessage)) | ||
expect(notificationsElement[0].innerHTML).toContain(notificationDefaultMessage) | ||
expect(notification.notificationElement.children('button').length).toBe(1) | ||
|
||
notification.setUserDismissable(false) | ||
|
@@ -491,7 +491,7 @@ describe('Notifications', () => { | |
$(() => { | ||
try { | ||
notification.notificationElement.remove() | ||
expect(notificationsElement[0].innerHTML).not.toContain(escape(notificationDefaultMessage)) | ||
expect(notificationsElement[0].innerHTML).not.toContain(notificationDefaultMessage) | ||
|
||
expect(() => { | ||
notification.setUserDismissable(true) | ||
|
@@ -508,13 +508,13 @@ describe('Notifications', () => { | |
test('changes the text of the notification', (done) => { | ||
$(() => { | ||
try { | ||
expect(notificationsElement[0].innerHTML).toContain(escape(notificationDefaultMessage)) | ||
expect(notificationsElement[0].innerHTML).toContain(notificationDefaultMessage) | ||
|
||
const newNotificationMessage = 'VOr%%:#Vc*tbNbM}iUT}' | ||
|
||
notification.setText(newNotificationMessage) | ||
|
||
expect(notification.notificationElement.text()).toContain(escape(newNotificationMessage)) | ||
expect(notification.notificationElement.text()).toContain(newNotificationMessage) | ||
done() | ||
} catch (error) { | ||
done(error) | ||
|
@@ -526,7 +526,7 @@ describe('Notifications', () => { | |
$(() => { | ||
try { | ||
notification.notificationElement.remove() | ||
expect(notificationsElement[0].innerHTML).not.toContain(escape(notificationDefaultMessage)) | ||
expect(notificationsElement[0].innerHTML).not.toContain(notificationDefaultMessage) | ||
|
||
expect(() => { | ||
notification.setText('new Text') | ||
|