Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsiher committed Jul 17, 2024
1 parent fbc8c7b commit ae35e0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions packages/dom/src/lib/ElementAssertion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ export class ElementAssertion<T extends Element> extends Assertion<T> {
actual: receivedValue,
expected: expectedValue,
message: isExpectedValuePresent
? `Expected the element to have attribute "${name}" with value "${expectedValue}", but received "${receivedValue}"`
: `Expected the element to have attribute "${name}"`,
? `Expected to have attribute "${name}" with value "${expectedValue}", but received "${receivedValue}"`
: `Expected to have attribute "${name}"`,
});

const invertedError = new AssertionError({
actual: receivedValue,
expected: expectedValue,
message: isExpectedValuePresent
? `Expected the element to NOT have attribute "${name}" with value "${expectedValue}", but received "${receivedValue}"`
: `Expected the element to NOT have attribute "${name}"`,
? `Expected to NOT have attribute "${name}" with value "${expectedValue}", but received "${receivedValue}"`
: `Expected to NOT have attribute "${name}"`,
});

return this.execute({
Expand Down
10 changes: 5 additions & 5 deletions packages/dom/test/unit/lib/ElementAssertion.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("[Unit] ElementAssertion.test.ts", () => {

expect(() => test.not.toHaveAttribute("type", "submit"))
.toThrowError(AssertionError)
.toHaveMessage(`Expected the element to NOT have attribute "type" with value "submit", but received "submit"`);
.toHaveMessage("Expected to NOT have attribute \"type\" with value \"submit\", but received \"submit\"");
});
});

Expand All @@ -71,7 +71,8 @@ describe("[Unit] ElementAssertion.test.ts", () => {

expect(() => test.toHaveAttribute("type", "different value"))
.toThrowError(AssertionError)
.toHaveMessage(`Expected the element to have attribute "type" with value "different value", but received "submit"`);
.toHaveMessage("Expected to have attribute \"type\" with value \"different value\", but received \"submit\"",
);

expect(test.not.toHaveAttribute("type", "different value")).toBeEqual(test);
});
Expand All @@ -87,7 +88,7 @@ describe("[Unit] ElementAssertion.test.ts", () => {

expect(() => test.not.toHaveAttribute("disabled"))
.toThrowError(AssertionError)
.toHaveMessage(`Expected the element to NOT have attribute "disabled"`);
.toHaveMessage("Expected to NOT have attribute \"disabled\"");
});
});

Expand All @@ -99,12 +100,11 @@ describe("[Unit] ElementAssertion.test.ts", () => {

expect(() => test.toHaveAttribute("non-existent"))
.toThrowError(AssertionError)
.toHaveMessage(`Expected the element to have attribute "non-existent"`);
.toHaveMessage("Expected to have attribute \"non-existent\"");

expect(test.not.toHaveAttribute("non-existent")).toBeEqual(test);
});
});


});
});

0 comments on commit ae35e0d

Please sign in to comment.