Skip to content

Commit

Permalink
test: add renaming case
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX committed Aug 26, 2024
1 parent caa5874 commit 3e910bb
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions packages/language-server/tests/renaming.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,93 @@ describe('Renaming', async () => {
`);
});

it('Scoped Classes', async () => {
expect(
await requestRename('fixture.vue', 'vue', `
<template>
<div :class="'foo|'"></div>
<div :class="['foo', { 'foo': true }]"></div>
<div :class="{ foo }"></div>
</template>
<style scoped>
.foo { }
</style>
`, 'bar')
).toMatchInlineSnapshot(`
{
"changes": {
"file://\${testWorkspacePath}/fixture.vue": [
{
"newText": "bar",
"range": {
"end": {
"character": 23,
"line": 4,
},
"start": {
"character": 20,
"line": 4,
},
},
},
{
"newText": "bar",
"range": {
"end": {
"character": 32,
"line": 3,
},
"start": {
"character": 29,
"line": 3,
},
},
},
{
"newText": "bar",
"range": {
"end": {
"character": 23,
"line": 3,
},
"start": {
"character": 20,
"line": 3,
},
},
},
{
"newText": "bar",
"range": {
"end": {
"character": 22,
"line": 2,
},
"start": {
"character": 19,
"line": 2,
},
},
},
{
"newText": "bar",
"range": {
"end": {
"character": 8,
"line": 7,
},
"start": {
"character": 5,
"line": 7,
},
},
},
],
},
}
`);
});

const openedDocuments: TextDocument[] = [];

afterEach(async () => {
Expand Down

0 comments on commit 3e910bb

Please sign in to comment.