fix: 설문조사 창 닫기 버튼이 팝업을 닫도록 수정
This commit is contained in:
@@ -1278,6 +1278,60 @@ test('keeps the survey footer close button the same size as the top close button
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('closes the survey popup from both close buttons without navigating the opener', async ({ page }, testInfo) => {
|
||||||
|
const state: NavigationFixture = {
|
||||||
|
officerLevel: 0,
|
||||||
|
permission: 0,
|
||||||
|
nationLevel: 0,
|
||||||
|
stage: 0,
|
||||||
|
npcMode: 1,
|
||||||
|
generalMeCalls: 0,
|
||||||
|
operations: [],
|
||||||
|
};
|
||||||
|
await installFixture(page, state);
|
||||||
|
await waitForMain(page);
|
||||||
|
const openerUrl = page.url();
|
||||||
|
for (const width of [1000, 500]) {
|
||||||
|
for (const bar of ['back_bar', 'bottom_bar']) {
|
||||||
|
const popupPromise = page.waitForEvent('popup');
|
||||||
|
await page.evaluate(() => window.open('about:blank', '_blank'));
|
||||||
|
const popup = await popupPromise;
|
||||||
|
await installFixture(popup, state);
|
||||||
|
await popup.setViewportSize({ width, height: 900 });
|
||||||
|
await popup.goto(`${basePath}/survey`);
|
||||||
|
const button = popup.locator(`.${bar} .back_btn`);
|
||||||
|
await expect(button).toHaveText('창 닫기');
|
||||||
|
await popup.evaluate(() => document.fonts.ready);
|
||||||
|
await button.focus();
|
||||||
|
await expect(button).toBeFocused();
|
||||||
|
await button.hover();
|
||||||
|
const artifactName = `survey-close-${width}-${bar}`;
|
||||||
|
await popup.screenshot({ path: testInfo.outputPath(`${artifactName}.png`), fullPage: true });
|
||||||
|
await writeFile(
|
||||||
|
testInfo.outputPath(`${artifactName}.html`),
|
||||||
|
await popup.locator('.pageVote').evaluate((el) => el.outerHTML)
|
||||||
|
);
|
||||||
|
await writeFile(
|
||||||
|
testInfo.outputPath(`${artifactName}.json`),
|
||||||
|
JSON.stringify(
|
||||||
|
await button.evaluate((el) => ({
|
||||||
|
rect: el.getBoundingClientRect().toJSON(),
|
||||||
|
style: { height: getComputedStyle(el).height, font: getComputedStyle(el).font },
|
||||||
|
})),
|
||||||
|
null,
|
||||||
|
2
|
||||||
|
)
|
||||||
|
);
|
||||||
|
const closed = popup.waitForEvent('close');
|
||||||
|
await button.click();
|
||||||
|
await closed;
|
||||||
|
expect(popup.isClosed()).toBe(true);
|
||||||
|
expect(page.isClosed()).toBe(false);
|
||||||
|
expect(page.url()).toBe(openerUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test('notifies only for a new incoming private message and marks it read from the notice', async ({
|
test('notifies only for a new incoming private message and marks it read from the notice', async ({
|
||||||
page,
|
page,
|
||||||
}, testInfo) => {
|
}, testInfo) => {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { formatServerDateTime } from '@sammo-ts/common/time/ServerDateTime';
|
import { formatServerDateTime } from '@sammo-ts/common/time/ServerDateTime';
|
||||||
import { computed, onMounted, ref } from 'vue';
|
import { computed, onMounted, ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
import { useGameFeedback } from '../composables/useGameFeedback';
|
import { useGameFeedback } from '../composables/useGameFeedback';
|
||||||
import { trpc } from '../utils/trpc';
|
import { trpc } from '../utils/trpc';
|
||||||
@@ -25,7 +24,7 @@ const myComment = ref('');
|
|||||||
const newVoteTitle = ref('');
|
const newVoteTitle = ref('');
|
||||||
const newVoteOptionsText = ref('');
|
const newVoteOptionsText = ref('');
|
||||||
const newVoteMultipleOptions = ref(1);
|
const newVoteMultipleOptions = ref(1);
|
||||||
const router = useRouter();
|
const closeWindow = (): void => window.close();
|
||||||
const { success: showSuccessToast, error: showErrorToast } = useGameFeedback();
|
const { success: showSuccessToast, error: showErrorToast } = useGameFeedback();
|
||||||
|
|
||||||
const getErrorMessage = (error: unknown): string => {
|
const getErrorMessage = (error: unknown): string => {
|
||||||
@@ -209,7 +208,7 @@ onMounted(() => {
|
|||||||
<button
|
<button
|
||||||
class="legacy-button legacy-button--navigation legacy-button--fixed-height back_btn"
|
class="legacy-button legacy-button--navigation legacy-button--fixed-height back_btn"
|
||||||
type="button"
|
type="button"
|
||||||
@click="router.push('/')"
|
@click="closeWindow"
|
||||||
>
|
>
|
||||||
창 닫기
|
창 닫기
|
||||||
</button>
|
</button>
|
||||||
@@ -409,7 +408,7 @@ onMounted(() => {
|
|||||||
<button
|
<button
|
||||||
class="legacy-button legacy-button--navigation legacy-button--fixed-height back_btn"
|
class="legacy-button legacy-button--navigation legacy-button--fixed-height back_btn"
|
||||||
type="button"
|
type="button"
|
||||||
@click="router.push('/')"
|
@click="closeWindow"
|
||||||
>
|
>
|
||||||
창 닫기
|
창 닫기
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user