Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
patinthehat committed Mar 29, 2024
1 parent 66a1a16 commit c0e0550
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Concerns/RayScreenColors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable no-unused-vars */
export class RayScreenColors {
/* istanbul ignore next */
public screenColor(color: string): this {
return this;
}
Expand Down
14 changes: 14 additions & 0 deletions tests/Ray.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ it('sends a color payload', () => {
expect(client.sentPayloads()).toMatchSnapshot();
});

it('sends screen color payloads', async () => {
const r = await getNewRay();
r.screenGreen().screenOrange().screenRed().screenPurple().screenBlue().screenGray();

expect(client.sentPayloads()).toMatchSnapshot();
});

it('sends a custom screen color payload', async () => {
const r = await getNewRay();
r.screenColor('red');

expect(client.sentPayloads()).toMatchSnapshot();
});

it('sends a label payload', () => {
myRay.label('test-123');

Expand Down
177 changes: 177 additions & 0 deletions tests/__snapshots__/Ray.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,29 @@ exports[`sends a custom payload 1`] = `
]
`;

exports[`sends a custom screen color payload 1`] = `
[
{
"meta": [],
"payloads": [
{
"content": {
"color": "red",
},
"origin": {
"file": "",
"function_name": "xxxx",
"hostname": "remote",
"line_number": 999,
},
"type": "screen_color",
},
],
"uuid": "fakeUuid",
},
]
`;

exports[`sends a hide payload 1`] = `
[
{
Expand Down Expand Up @@ -1099,6 +1122,47 @@ exports[`sends a screen color payload 1`] = `
]
`;

exports[`sends a screen color payload 2`] = `
[
{
"meta": [],
"payloads": [
{
"content": {
"color": "red",
},
"origin": {
"file": "",
"function_name": "xxxx",
"hostname": "remote",
"line_number": 999,
},
"type": "screen_color",
},
],
"uuid": "fakeUuid",
},
{
"meta": [],
"payloads": [
{
"content": {
"color": "green",
},
"origin": {
"file": "",
"function_name": "xxxx",
"hostname": "remote",
"line_number": 999,
},
"type": "screen_color",
},
],
"uuid": "fakeUuid",
},
]
`;

exports[`sends a separator payload 1`] = `
[
{
Expand Down Expand Up @@ -1689,6 +1753,119 @@ exports[`sends an xml payload 1`] = `
]
`;

exports[`sends screen color payloads 1`] = `
[
{
"meta": [],
"payloads": [
{
"content": {
"color": "green",
},
"origin": {
"file": "",
"function_name": "xxxx",
"hostname": "remote",
"line_number": 999,
},
"type": "screen_color",
},
],
"uuid": "fakeUuid",
},
{
"meta": [],
"payloads": [
{
"content": {
"color": "orange",
},
"origin": {
"file": "",
"function_name": "xxxx",
"hostname": "remote",
"line_number": 999,
},
"type": "screen_color",
},
],
"uuid": "fakeUuid",
},
{
"meta": [],
"payloads": [
{
"content": {
"color": "red",
},
"origin": {
"file": "",
"function_name": "xxxx",
"hostname": "remote",
"line_number": 999,
},
"type": "screen_color",
},
],
"uuid": "fakeUuid",
},
{
"meta": [],
"payloads": [
{
"content": {
"color": "purple",
},
"origin": {
"file": "",
"function_name": "xxxx",
"hostname": "remote",
"line_number": 999,
},
"type": "screen_color",
},
],
"uuid": "fakeUuid",
},
{
"meta": [],
"payloads": [
{
"content": {
"color": "blue",
},
"origin": {
"file": "",
"function_name": "xxxx",
"hostname": "remote",
"line_number": 999,
},
"type": "screen_color",
},
],
"uuid": "fakeUuid",
},
{
"meta": [],
"payloads": [
{
"content": {
"color": "gray",
},
"origin": {
"file": "",
"function_name": "xxxx",
"hostname": "remote",
"line_number": 999,
},
"type": "screen_color",
},
],
"uuid": "fakeUuid",
},
]
`;

exports[`sends show and hide app payloads 1`] = `
[
{
Expand Down

0 comments on commit c0e0550

Please sign in to comment.