Skip to content

Commit

Permalink
Update CSS selector for base repository on gitlab.com (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
RicePatrick authored Jan 31, 2025
1 parent e88e4ec commit 5f85ef5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ image:
tasks:
- name: install node version
init: |
sudo apt update
sudo apt install -y nodejs
nvm install 20
nvm use 20
nvm uninstall 16
Expand Down
2 changes: 1 addition & 1 deletion src/button/button-contributions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const buttonContributions: ButtonContributionParams[] = [
],
// must not match /blob/ because that is a file
match: /^(?!.*\/blob\/).*$/,
selector: "#tree-holder > div > div.tree-controls > div:first-child",
selector: "#tree-holder .tree-controls",
containerElement: { type: "div", props: { marginLeft: "8px" } },
application: "gitlab",
manipulations: [
Expand Down
2 changes: 1 addition & 1 deletion test/src/button-contributions-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const buttonContributions: ButtonContributionParams[] = [
],
// must not match /blob/ because that is a file
match: /^(?!.*\/blob\/).*$/,
selector: "#tree-holder > div > div.tree-controls > div:first-child",
selector: "#tree-holder .tree-controls",
containerElement: { type: "div", props: { marginLeft: "8px" } },
application: "gitlab",
manipulations: [
Expand Down
10 changes: 5 additions & 5 deletions test/src/button-contributions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ describe("Platform match tests", function () {

before(async function () {
browser = await puppeteer.launch({
headless: "new",
product: "chrome",
headless: true,
browser: "chrome",
});
page = await browser.newPage();
});
Expand Down Expand Up @@ -66,8 +66,8 @@ describe("Query Selector Tests", function () {

before(async function () {
browser = await puppeteer.launch({
headless: "new",
product: "chrome",
headless: true,
browser: "chrome",
});
page = await browser.newPage();
});
Expand All @@ -78,7 +78,7 @@ describe("Query Selector Tests", function () {

async function resolveSelector(page: Page, selector: string) {
if (selector.startsWith("xpath:")) {
return (await page.$x(selector.slice(6)))[0] || null;
return (await (page as any).$x(selector.slice(6)))[0] || null;
} else {
return page.$(selector);
}
Expand Down

0 comments on commit 5f85ef5

Please sign in to comment.