Skip to content

Commit

Permalink
test: add test case for [foo*="bar"] (fixes #20)
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Nov 1, 2017
1 parent c531b7a commit 7c3ab7f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/surgeon/queries/single-match.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,16 @@ test('reads childNodes', (t): void => {

t.true(x(query, subject)[0].nodeValue === 'bar');
});

test('extracts a single value (expression string [foo*="bar"])', (t): void => {
const x = surgeon();

const subject = `
<div foo="barbaz">bar</div>
`;

// eslint-disable-next-line quotes
const query: DenormalizedQueryType = `select '[foo*="bar"]' | read property textContent`;

t.true(x(query, subject) === 'bar');
});

0 comments on commit 7c3ab7f

Please sign in to comment.